Comments (8)
the static directory is a problem. but the rest is really supposed to be up to the user to determine.
however maybe we need a gnorm demo command that spits out a valid example to show how the pieces run together.
from gnorm.
Every implementation will eventually have its own configuration. However, it would be decent for someone trying gnorm out to be able to start playing with the generated DSL asap, figure out if this project fits their needs, and then go back and reconfigure/customize templates.
from gnorm.
I agree with the assertion that defaults should just work. Adding a command to copy (and not overwrite) a sane table, schema, and enum template would go a long way in getting a new user up and running quickly. Yes, they will need to modify it at some point, but that is a lot easier than writing one from scratch.
I was also a little confused as to why the typemaps were not enabled by default. It should work great for most users and the remaining users would only need to modify what is already there.
from gnorm.
Well, ok, so part of the reason is that, in theory, Gnorm is not just for Go programmers. This could be used for creating docs, for creating protobuf definitions, or even code in some other language.
Also, the typemaps are DB-specific, like MySQL has longtext and postgres doesn't. As more databases are added, they're more likely to get different types.
What we might want is like gnorm init <language> <database>
and have pre-made templates for each. so like you'd do gnorm init go mysql
or gnorm init protobuf postgres
The idea is to eventually have a gallery of solutions the way Hugo has a gallery of themes. It's a little harder here, because we can't just steal port themes from pre-existing generators (or, maybe we can, if anyone knows of some).
from gnorm.
The expanded init command would be a good middle ground. This would be easy to direct new users to do through a quick start or getting started section.
In the short term (prior to getting the gallery going), we could also consider a separate github project with either templates organized into directories or an index md that points to other github projects that contain just a set of quality templates. Essentially a curated collection.
from gnorm.
The curated collection definitely is a good idea. I have a set of templates that create Go DB wrappers mostly ready to go, converted from what we use at work.
I'd also like to see if there's a way to make it easy to convert from xo to gnorm. Xo is like a specialized version of gnorm that only produces go code.
Xo has a lot of custom functions that we could probably duplicate with a plugin.... but I haven't looked at how hard it would be to convert. My guess is right now it would be quite a bit of work, even if the general layout of the code is the same... xo has a lot of very customized functions for turning its schema into go code. With embedded templates (#60) and plugins, we might be able to make it a lot easier, though.
from gnorm.
Any update for this issue?
from gnorm.
https://github.com/gnormal/postgres-go is a ready-to-use set of templates for generating go code for a postgres DB that are 99% the same as what I use at work.
from gnorm.
Related Issues (20)
- mssql support HOT 1
- sqlite support HOT 2
- Versus on website is disingenuous towards sqlboiler HOT 5
- Add useful default templates HOT 16
- Gnorm does not seem to work with recent mysql version (v8) HOT 2
- MariaDB, Error: name "GENERATION_EXPRESSION": unsupported Scan HOT 1
- Schema.Enums contains one value for each value instead of each type HOT 9
- Support for keyword table names in Postgres
- gnorm do not recognize default value from identity
- ForeignKeyRefs being overwritten
- Support for TableType HOT 1
- Is this project dead ? HOT 4
- Error : function "plural" not defined
- Is there a Protobuf example? HOT 8
- Build instructions don't work as given HOT 5
- Build instructions don't match the source code
- Why am I getting this? Error: error scanning foreign key constraint: sql: Scan error on column index 5, name "table_name": converting NULL to string is unsupported HOT 12
- pq version does not work with postgres 10 HOT 2
- database/drives/postgres/parse.go::queryEnums query adds an enum per enum value rather than actual enum HOT 2
- Table name is unknown in enum generation
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 gnorm.