Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres support #1

Closed
atreeon opened this issue Jun 8, 2022 · 5 comments
Closed

Postgres support #1

atreeon opened this issue Jun 8, 2022 · 5 comments

Comments

@atreeon
Copy link

atreeon commented Jun 8, 2022

Hello. I couldn't seem to get the legacyV3 version working either like your post here Jaguar-dart/jaguar_orm#197

I wondered if you might be able to help make this work for postgres? I tried for a couple of hours yesterday to get it to compile but I didn't have any joy.

@isaacfi
Copy link
Owner

isaacfi commented Jun 8, 2022

Hi @atreeon,

Sorry I don't know postgres and might not be helpful. But did you try to compile the code here or the levacyV3? I used the jaguar ORM for flutter-sqlite. What is the purpose for using postgres in your case?

@atreeon
Copy link
Author

atreeon commented Jun 9, 2022

Thank you for your reply @isaacfi. My purpose for using postgres is already set by the client, they have an existing database that I need to access. It is all server side dart so a little out of the norm.

I tried to compile the legacyV3 code first but it seems like legacyV3 postgres side of it wasn't upgraded to nullsafe so it just fails to compile.

For example the jaguar_query_postgresql project uses dart sdk sdk: '>=2.0.0-dev.55.0 <2.0.0' which is super old.

Its a shame as it looks like a good ORM but nobody seems to be supporting the postgres side of it.

@isaacfi
Copy link
Owner

isaacfi commented Jun 9, 2022

Hi @atreeon,

Yes, you are right about the lack of support, that's why I did my own null safe version, I think you can to start with my code, this should compile, and you can ask me help If you won't. After, make some tests for postgreSQL with the jaguar_query_postgres adapter, but I ignore if this has a null safety implementation, and finally if you want to use the generation code, you need to change the code here sqflite to adapt it to the postgreSQL syntaxis and data types.

@isaacfi
Copy link
Owner

isaacfi commented Jun 9, 2022

I forgot to tell you about the references, like these:

As you can see, the references points to the github code, and it's because I am using a git reference in the pubspect.yaml of my main project, and every dependency should be in github or as external lib. So, if you want to make local tests and make it work together in your development environment, you have to change the reference to local paths, for example:

dependencies:
  jaguar_query: # ^2.2.9
    git:
      url: https://github.com/isaacfi/jaguar_orm_nullsafe.git
      path: query
  jaguar_orm: # ^2.2.7
    git:
      url: https://github.com/isaacfi/jaguar_orm_nullsafe.git
      path: orm

to:

dependencies:
  jaguar_query: # ^2.2.9
    path: ../query
  jaguar_orm: # ^2.2.7
    path: ../orm

Happy coding.

@atreeon
Copy link
Author

atreeon commented Jun 9, 2022

Thanks so much @isaacfi, I'll have a play a little later on all being well

@isaacfi isaacfi closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants