Giter Site home page Giter Site logo

Comments (8)

martin-georgiev avatar martin-georgiev commented on August 9, 2024 1

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.

martin-georgiev avatar martin-georgiev commented on August 9, 2024

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.

isaackearl avatar isaackearl commented on August 9, 2024

@martin-georgiev

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.

isaackearl avatar isaackearl commented on August 9, 2024

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.

isaackearl avatar isaackearl commented on August 9, 2024

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.

isaackearl avatar isaackearl commented on August 9, 2024

Wow thanks martin!

That sounds amazing.

from postgresql-for-doctrine.

martin-georgiev avatar martin-georgiev commented on August 9, 2024

Hey Isaack,
Sorry I couldn't get back to you sooner.

Do you still need help with this?

from postgresql-for-doctrine.

isaackearl avatar isaackearl commented on August 9, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.