Giter Site home page Giter Site logo

Comments (5)

aarondl avatar aarondl commented on April 28, 2024 1

@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.

aarondl avatar aarondl commented on April 28, 2024

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.

nullbio avatar nullbio commented on April 28, 2024

Closing due to inactivity. Please re-open if you (or anyone else) is still interested in this.

from sqlboiler.

cornfeedhobo avatar cornfeedhobo commented on April 28, 2024

@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.

cornfeedhobo avatar cornfeedhobo commented on April 28, 2024

@aarondl Yes I am looking into that now. thank you again!!

from sqlboiler.

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.