faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
snsei has joined #amber
snsei has quit [Ping timeout: 268 seconds]
snsei has joined #amber
snsei has quit [Ping timeout: 250 seconds]
snsei has joined #amber
snsei has quit [Ping timeout: 268 seconds]
<FromGitter> <anamba> is it just me or does this happen to anyone else? every now and then, amber watch will successfully recompile and terminate the old version, but then fail to actually start the new version
<FromGitter> <anamba> i either run it by hand or touch a file to compile again... both annoying
<FromGitter> <anamba> hmm.. does jasper_helpers not have a helper for radio buttons
<FromGitter> <drujensen> Yea, watch needs some tlc. Need to make it configurable to remove the npm dependency as well. @faustinoaq, where r u when we need you? 😉
<FromGitter> <drujensen> I don’t think we added radio buttons yet.
<FromGitter> <anamba> no worries. i'm making a radio button helper (similar to check_box) and will open a PR once i like it enough. shouldn't take too long. no idea what's up with watch though.
<FromGitter> <anamba> that reminds me (i don't know how, but it does), is it possible to remove all those db shards as dependencies? i don't use any of them (i use neo4j and couchdb)
<FromGitter> <drujensen> To compile the Amber binary, it requires those shards
<FromGitter> <drujensen> But it your app doesn’t need them, you can remove them
<FromGitter> <anamba> i removed that amber target from my shard.yml (why does that get put in there by default anyway?) but all the db shards still show up in my shard.lock because amber is a dependency of my app
<FromGitter> <drujensen> Amber should have those as dev dependencies
<FromGitter> <drujensen> Most people will want the CLI for running migrations in production
<FromGitter> <drujensen> I have attempted several times to remove them but they are not compiled in the binary so shouldn’t be an issue
<FromGitter> <drujensen> Except it looks like your app has a bunch of dependencies which it doesn’t.
<FromGitter> <drujensen> I personally only want to see real dependencies in my project
<FromGitter> <drujensen> Maybe someday we will figure out how to do that
<FromGitter> <Blacksmoke16> would be nice if libs installed in prod mode skipped the spec directory
<FromGitter> <Blacksmoke16> i dont need that much extra MB taking up space that isnt used
<FromGitter> <drujensen> Yup
<FromGitter> <Blacksmoke16> well maybe a few 100 Kb at most but still
<FromGitter> <drujensen> We need to create a staged docker image for prod
<FromGitter> <drujensen> The current one is only focused on dev
<FromGitter> <Blacksmoke16> for amber?
<FromGitter> <drujensen> A template
<FromGitter> <Blacksmoke16> ah
<FromGitter> <drujensen> That will install only the binary and needed deps
<FromGitter> <drujensen> One with a CIS secured base image
<FromGitter> <codematix> Hello, could anybody please help me understand if Granite ORM supports transactions and if yes are there any links or documentation about using transactions.
snsei has joined #amber
snsei has quit [Remote host closed the connection]
<FromGitter> <Blacksmoke16> @codematix not directly afaik
<FromGitter> <codematix> @Blacksmoke16 , do you mean there is no support or that there is no reference for them
<FromGitter> <theecodedragon> Hello everyone, New to Amber framework i have a small doubt about generating migration from existing model created, I am using default granite shipped with Amber. ⏎ Is there specific example i need to look at, unfortunately i couldn't find a good refernce.
_whitelogger has joined #amber
<FromGitter> <drujensen> HI @codematix . Granite is using the `crystal-db`. DML calls are wrapped in transaction but there is no interface for nested transactions yet. You can get the underlying adapter and possibly use https://github.com/crystal-lang/crystal-db/pull/27.
<FromGitter> <drujensen> `User.adapter.transaction do |tx|` Not sure this is what you want to do though.
<FromGitter> <drujensen> Another option is crecto. https://www.crecto.com/crecto-multi
<FromGitter> <Blacksmoke16> @theecodedragon what are you trying to do?
<FromGitter> <drujensen> @theecodedragon You can see the mapping for the Amber migration generator here: https://github.com/amberframework/amber/blob/master/src/amber/cli/templates/field.cr
<FromGitter> <drujensen> so `amber g model name:string` will use `String` in the model and `VARCHAR` in the migration
<FromGitter> <drujensen> mysql override is `VARCHAR(255)`
<FromGitter> <Blacksmoke16> i refactored granite migrator, can be tested now
<FromGitter> <Blacksmoke16> to make sure its generating the correct sql
snsei has joined #amber
snsei_ has joined #amber
snsei has quit [Ping timeout: 250 seconds]
<FromGitter> <drujensen> You know. Thinking out loud. I think @elorest mentioned this. What if the binary created by an Amber project had the ability to run migrations instead of lugging around the amber binary when deploying to production?
snsei_ has quit [Remote host closed the connection]
snsei has joined #amber
<FromGitter> <drujensen> That would avoid needing to include all the dev shards.
snsei has quit [Ping timeout: 268 seconds]
snsei has joined #amber
snsei has quit [Remote host closed the connection]
snsei has joined #amber
snsei has quit [Read error: Connection reset by peer]
snsei_ has joined #amber
<FromGitter> <Blacksmoke16> isnt that what micrate is for?
snsei_ has quit [Remote host closed the connection]
snsei has joined #amber
snsei has quit [Ping timeout: 268 seconds]
snsei has joined #amber
snsei has quit [Ping timeout: 250 seconds]
snsei has joined #amber
<FromGitter> <drujensen> yes. micrate or amber cli will run the migrations in production
<FromGitter> <drujensen> just thinking if we should include this on the production docker image
<FromGitter> <drujensen> to be able to run migrations. Also, we would need to include the migration scripts.
<FromGitter> <elorest> It would be pretty simple to do and wouldn't change compile times much.
<FromGitter> <drujensen> so the binary would have cli options for running migrations
<FromGitter> <elorest> We'd probably want to be able to compile that part of the CLI in without everthing else right?
<FromGitter> <drujensen> yes
snsei has quit [Ping timeout: 250 seconds]
<FromGitter> <drujensen> i don’t think we need the `amber db create drop` commands
<FromGitter> <drujensen> so it would be `bin/blog migrate seed rollback` or something like that
<FromGitter> <drujensen> we could also add `bin/blog run some_script.cr` to replace rake tasks
<FromGitter> <drujensen> again just thinking out loud
<FromGitter> <theecodedragon> @Blacksmoke16 thanks for the response, I am trying to understand how i can create migrations for models that i have manually writtnen and not created using generator
<FromGitter> <theecodedragon> @drujensen apologize about the delayed response and thank you for the inputs but not sure how to make this work, each time i try and create a migrations for the model i have manually written i see an empty migration, maybe i am just doing something wrong.
snsei has joined #amber
<FromGitter> <elorest> I've been working on BitFields for crystal all day. I'm taking my kids to a sledding thing right now but if you want to brainstorm any of this feel free to give me a call.
snsei has quit [Ping timeout: 250 seconds]
snsei has joined #amber
snsei has quit [Ping timeout: 246 seconds]
snsei has joined #amber
snsei has quit [Ping timeout: 250 seconds]
<FromGitter> <drujensen> @theecodedragon I would create the migration file using `amber g migration create_post`
<FromGitter> <drujensen> and then edit the file generated and add the create table command in the up: ⏎ ⏎ `````` [https://gitter.im/amberframework/amber?at=5c0c55ec4808192b03082ca3]
<FromGitter> <drujensen> and then drop in the down section: ⏎ ⏎ ```DROP TABLE IF EXISTS posts;``` [https://gitter.im/amberframework/amber?at=5c0c5611f992693c7a43a43a]