turnkey-commerce / gendal Goto Github PK
View Code? Open in Web Editor NEWCommand line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, Microsoft SQL Server, and CockroachDB
License: MIT License
Command line tool to generate idiomatic Go code for SQL databases supporting PostgreSQL, MySQL, SQLite, Oracle, Microsoft SQL Server, and CockroachDB
License: MIT License
When updating gendal, it fails because of a renamed dependency:
$ go get -u github.com/turnkey-commerce/gendal
go get: github.com/knq/[email protected] updating to
github.com/knq/[email protected]: parsing go.mod:
module declares its path as: github.com/kenshaw/snaker
but was required as: github.com/knq/snaker
This is due to github.com/knq/snaker
which changed its name to github.com/kenshaw/snaker
on 2021-07-30 (7 days ago...).
I'm currently using the cockroachdb connection string against my cockroach db and during generation the foreignkey.go.tpl does not always generate all foreignkey relationship functions from the table. I have tested this on the postgres connection string against my postgres db and it works every time but going through cockroach it appears to be very random, sometimes it's generating half the foreignkey functions, sometimes 80% of them and sometimes all of them.
Anyone else using cockroachdb and getting this random behavior?
Since version 1.2.7
, command line arguments are ignored when a config file is present. The following scenarios happen:
❯ gendal --version
error: Database DSN must be provided
❯ gendal "postgres://postgres@localhost/some_db" [...]
error: Database DSN must be provided
❯ gendal --version
config file not found, using command line arguments
gendal version 1.2.7
❯ gendal "postgres://postgres@localhost/some_db" [...]
config file not found, using command line arguments
[gendal generates according to CLI arguments]
❯ gendal --version
[gendal generates using the config file options; no CLI ouput as expected]
❯ gendal --suffix ".a_random_suffix"
[gendal generates but ignores the `suffix` option]
Hey, we would be really pleased to use #18 in our project so for now we stick to commit version 13b932a but it would be cleaner on our side to point to a specific release version number.
Do you think it's possible to release a new version of gendal containing those changes ?
Thank you very much for your work.
Will be good to have an option for a configuration file (preferably TOML) that will allow the user to make the settings for a particular project rather than rely only on command line arguments. That way the generation will be more repeatable, particularly for use cases involving custom types from custom queries. Also it will be easier to support concepts of ignoring tables or white-listing tables and ensuring consistent generation over the life of a project.
gendal
is still using dep.
It would be great to move to go modules.
I have the code ready and I'd be happy to submit a PR, but it is based on top of #10 and #11.
Do you prefer a PR with all 3 or shall I wait for you to merge those first.
You can have a look at the changes here.
Note: I am not fully familiar with deps/go mod yet, so any feedback is welcome.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.