Giter Site home page Giter Site logo

Postgres Support about honeydew HOT 6 CLOSED

koudelka avatar koudelka commented on August 15, 2024
Postgres Support

from honeydew.

Comments (6)

jeremyjh avatar jeremyjh commented on August 15, 2024

I guess your tests are using cockroachdb, is why they passed? Cockroach is only compatible at the protocol level, it is not source or feature compatible with postgres. For some reason in the case of extract function they chose not to even be compatible with ANSI SQL.

from honeydew.

koudelka avatar koudelka commented on August 15, 2024

just pushed proper postgres support in 8134472 on master, try it out and let me know how it goes. :)

from honeydew.

jeremyjh avatar jeremyjh commented on August 15, 2024

@koudelka It works, thanks! Glad to have this in the main repository already.

I have a couple of suggestions based on the path I was headed down.

The SQL in your Postgres module looks like pure ANSI, no special Postgres features. I'd call the module "ANSI". I'd also suggest changing the option you pass to honeydew_fields as dialect rather than database. Dialects now would be :cockroach and :ansi, in the future maybe someone will add :cql for Cassandra etc.

Second, you could have a single example project support multiple database adapters and run the test suite on both of them by using a separate MIX_ENV. I had started to make a separate MIX_ENV=pg_test, which changed the adapter - you could also use it in the migration to select the database/dialect depending on the value of Mix.env. I didn't get that far since you mentioned you were working on this, but the first step of the mix.config I did here: smartmetals@e0edef0

If you take both these suggestions adding support for Maria is completely trivial I think, it would just be another MIX_ENV for test and I don't think would require any different SQL code but I didn't try it yet.

from honeydew.

koudelka avatar koudelka commented on August 15, 2024

Can you see a reason to want to select which dialect is used, outside of needing to manually select it when the adapter is ambiguous?

Thanks for the MIX_ENV idea! I really didn't like the idea of duplicating the example project. :)

from honeydew.

jeremyjh avatar jeremyjh commented on August 15, 2024

@koudelka No, I think if the macros can get access to the applications' Repo configuration you could save the user the trouble, but I think also if a single ANSI dialect will cover Postgres and MySQL (as written it would work with SQL Server and Oracle too, I think) you can just default to that, which will cover 95% of users.

from honeydew.

koudelka avatar koudelka commented on August 15, 2024

combined the example into a single project, thanks again for the suggestion. :)

from honeydew.

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.