Comments (8)
Thanks for pointing out the outdated Laravel instructions in the README. They were written some time ago both LaravelDoctrine and Laravel have moved forward since then. I'll revise the README to reflect the latest LaravelDoctrine release and will come back to you with more examples.
from postgresql-for-doctrine.
What is your use case? Can you share pseudo code of what you are doing? Also, are you integrating with a specific framework?
from postgresql-for-doctrine.
So I've been looking around and your package seems to be exactly what I need. I essentially want to be able to store json objects and then query them in dql etc being able to filter by keys or values etc in the json.
However after trying to get things installed last night, I'm thinking now that this package may have been written and tested against an older version of Laravel Doctrine. I couldn't get it to work. Here are a few of the issues:
'guid' => VoucherCodes\GUID\Doctrine\DBAL\Types\Guid::class,
'guid[]' => VoucherCodes\GUID\Doctrine\DBAL\Types\GuidArray::class,
These guid types are not found and I can't find the package on github that they are supposed to be from.
So I tried removing the mapping_types for guid to see if I could do without it
'mapping_types' => [
//'enum' => 'string'
'jsonb' => 'jsonb',
'_jsonb' => 'jsonb[]',
'jsonb[]' => 'jsonb[]',
// 'guid' => 'guid',
// '_guid' => 'guid[]',
// 'guid[]' => 'guid[]',
'_int2' => 'smallint[]',
'smallint[]' => 'smallint[]',
'_int4' => 'integer[]',
'integer[]' => 'integer[]',
'_int8' => 'bigint',
'bigint[]' => 'bigint[]',
'_text' => 'text[]',
'text[]' => 'text[]',
]
However I still get errors trying to do database operations or generate migrations from a diff etc.
[Illuminate\Contracts\Container\BindingResolutionException]
Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\Supp
ort\Manager
Another thing is that the Readme says to add to the "type_mappings", but in the most recent stable laravel doctrine package they are called "mapping_types".
Because of that change I assumed in my new DoctrineServiceProvider that I would need to change the entity manager key to "mapping_types" as well...
I set the new Service Provider in my app.php, but it still doesn't work.
from postgresql-for-doctrine.
I've spent more time trying to figure out how to install things... and I found this post: (from you it looks like)
https://stackoverflow.com/questions/31272850/register-custom-doctrine-dbal-types-in-laravel
I'm wondering if this is more accurate then the current readme... I'm wondering if I actually need to make the event subscriber and doctrine service provider etc...
in the doctrine.php config file for laravel doctrine there is this section:
'events' => [
'listeners' => [],
'subscribers' => []
],
which makes me believe I should be putting something there...
Sorry, my questions are just sorta random now but I would like to get this working. I will be using the package heavily if I can get it to work and will probably try and contribute etc. I'm thinking a good pull request would be a service provider that comes with the package that can just be added to the app.php etc. I will try and work on that if I can figure out how things work.
from postgresql-for-doctrine.
I worked on it most the day today...
I think I sort of got things working, at least for using the custom type to create my migrations etc.
Now I want to do soemthing simple, like query a field that contains json values so it filters it by a particular field. I can usually do this with laravel eloquent by doing something like this:
$users = DB::table('users')
->where('options->language', 'en')
->get();
where the options field contains json and the 'language' is a key....
I'm thinking if you can help me get that far just to do this simple type of query using doctrine then I will be very grateful. but I can't figure out how to use any of the custom_string_functions... in DQL or anywhere for that matter..
Thanks.
from postgresql-for-doctrine.
Wow thanks martin!
That sounds amazing.
from postgresql-for-doctrine.
Hey Isaack,
Sorry I couldn't get back to you sooner.
Do you still need help with this?
from postgresql-for-doctrine.
@martin-georgiev It's ok! I understand you are probably very busy with other projects etc. If you have time I would really appreciate it, I am still planning on using your package, but for now have started creating some workarounds using native queries. Thanks!
from postgresql-for-doctrine.
Related Issues (20)
- heavy composer package with uneeded files HOT 2
- How to use TO_JSON with JSON_GET_FIELD_AS_TEXT HOT 1
- jsonb_build_object support? HOT 1
- Postgres 14-specific JSON syntax HOT 1
- array_agg doesn't support ORDER BY HOT 1
- float[] type
- Jsonb::convertToPHPValue(): Return value must be of type array|string|int|float|null, bool returned HOT 2
- symfony / doctrine configuration help HOT 1
- getResults() returns arrays instead of objects HOT 1
- ? and ?| operators HOT 4
- `ANY` should accept `text[]` field, currently throw a `Expected Doctrine\ORM\Query\Lexer::T_SELECT` HOT 2
- Dependency Dashboard
- Cant install 2.1.1 version HOT 1
- Error with symfony and dql ilke function HOT 1
- Error with UNACCENT HOT 2
- Jsonb type limited convert HOT 4
- Cannot use object of type Doctrine\Common\Lexer\Token as array HOT 1
- Add support for DBAL v4 HOT 3
- InArray use ANY instead of ANY_OF HOT 2
- Wanted to add your package in PHP 8.0.12 project, but PHP version requirement is not met HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postgresql-for-doctrine.