Comments (5)
@cornfeedhobo We've actually refactored main.go away from most of the useful code. boilingcore is now the package that has the useful things. Main.go now only contains command line arg / config logic which you could pretty easily replicate. Maybe that works for you?
from sqlboiler.
Hey there @cornfeedhobo.
I'd be okay with this but let's talk it out some first. We even had this structure at one point (cmd
folder and with the lib front and center) but we dropped it because it wasn't useful to anyone since the binary is really what people are after when you go get
the project so we got rid of it for the vanity path.
The first thing I want to clarify is how sqlboiler is intended to be used. The binary sqlboiler is only for generation and only has to be used when your database changes. It's very easy to create a script "update-models" (or make piece) that will basically do the following (your single binary could do the same via exec):
go get -u -t github.com/vattle/sqlboiler # install latest binary
glide update # or what have you for updating your vendored copies from GOPATH
go generate
The other question is, is there any way we can discourage this path? We try to take our versioning seriously and have been delivering good fixes so unless you have CI delivering this single binary you'd be missing these fixes until someone noticed you needed an update. We could create a binary install that comes with the templates in the same directory. Maybe an install script? Would this make it better or worse? Just looking for ideas here :)
So, if none of the above solves your problems and you still want to proceed down this path:
One of the problems to consider is the management of the template files. First off loading them may be a chore since currently we just glob up the directories. If you were to do a single binary install of it there'd have to be some sort of provider implementation for the people who use it now from the fs and for people who use some sort of single binary style (I assume you're using gobindata or something?). This is the main issue.
I'd want to keep the vanity go get
path we have now, so we wouldn't move to the cmd/sqlboiler
package style probably because most people will still be using it as it's used today.
Thoughts?
from sqlboiler.
Closing due to inactivity. Please re-open if you (or anyone else) is still interested in this.
from sqlboiler.
@aarondl Sorry I did not respond at the time.
I guess all I can say is that I think all your points are good, but I value embedding and versioning over asking teammates to update sqlboiler directly, and I am not certain it's something you need to discourage.
I have a work around that works, but it would be nice to not work around this.
I've been exploring this other framework that also uses generation, and I like their solution to folks that want to vendor like me. https://goa.design/design/vendoring/
Thanks again for all the hard work.
from sqlboiler.
@aarondl Yes I am looking into that now. thank you again!!
from sqlboiler.
Related Issues (20)
- types aliasing only replaces one type
- Request to revert PR #1290 (BUG) HOT 3
- Bug in `queries.MakeStructMapping` when boil tag is `boil:",bind"` HOT 1
- [feature request] MySQL Optimizer Hints HOT 4
- FeatureRequest: struct tag case only for json HOT 3
- Bug in queries/reflect.go in which bind does not check rows.Err() prior to returning sql.ErrNoRows HOT 1
- Bug when binding to *struct in struct HOT 1
- AndIn generates a list of pairs instead of a flat list. HOT 1
- Non deterministic column binding when same column name across two tables (inner join) HOT 1
- Configuring aliases for relationships for sqlite is not working HOT 6
- types.Hstore does not works HOT 1
- Foreign key causes "panic: interface conversion: string is not error: missing method Error" HOT 1
- Error: can't evaluate field IsView in type drivers.Table HOT 2
- Bug/breaking change on upsert with postgres in v4.16.0 HOT 1
- OrWhere wrong in docs HOT 2
- `json_extract` not working with `Bind` HOT 1
- sqlboiler model generation not working with Vitess (MySQL CNFC scalable) due to subqueries HOT 1
- After specifying tag-ignore , sqlboiler is failing to generate the code HOT 3
- sqlboiler auto-generates replaced and unused (enum) type into boil_types.go HOT 8
- Timestamps in sqlite HOT 1
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 sqlboiler.