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
_whitelogger has joined #amber
marenz has joined #amber
feepbot has quit [Ping timeout: 250 seconds]
feepbot has joined #amber
marenz has quit [Read error: No route to host]
marenz has joined #amber
<FromGitter> <eliasjpr> So excited about the first Crystal book https://pragprog.com/book/crystal/programming-crystal
<FromGitter> <eliasjpr> Amber is featured in one of the chapters
<FromGitter> <elorest> Super cool.
<FromGitter> <eliasjpr> Super, I mean super!
<FromGitter> <elorest> For real. πŸ‘
<FromGitter> <johansmitsnl> I'm trying to add jennifer to the project but get this error at compilation: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I noticed that the config is slightly different from the docs so more might be changed? [https://gitter.im/amberframework/amber?at=5ba29ae1f4bd1056ac88f3b2]
<FromGitter> <eliasjpr> @johansmitsnl you might want to load jennifer with an initializer
<FromGitter> <eliasjpr> I think the order of requires affect the results
<FromGitter> <eliasjpr> you want the pg adapter to be loaded before `require "jennifer/adapter/postgres"`
<FromGitter> <elorest> Shouldn't jennifer require it's deps?
<FromGitter> <elorest> It's possible that Jennifer has changed something in their recent versions.
<FromGitter> <eliasjpr> I believe the pg-adapter is not loaded
<FromGitter> <eliasjpr> @johansmitsnl there is a branch for a jennifer recipe here https://github.com/amberframework/recipes/pull/20
<FromGitter> <eliasjpr> was recently updated to support the latest version of Jennifer/Amber
<FromGitter> <johansmitsnl> > @johansmitsnl there is a branch for a jennifer recipe here https://github.com/amberframework/recipes/pull/20 ⏎ ⏎ This config works πŸ‘
<FromGitter> <johansmitsnl> @eliasjpr thnx
<FromGitter> <eliasjpr> Awesome! let me know if there anything else we can help you with
<FromGitter> <elorest> πŸ‘
<FromGitter> <johansmitsnl> @eliasjpr what is the way to create a new model with a migration? when I run `amber g model ` I still get a `granite` model and migration. ⏎ ⏎ Running `crystal sam.cr -- generate:migration ` does nothing ⏎ ⏎ .amber.yml: ... [https://gitter.im/amberframework/amber?at=5ba2a230b9531f2dfa8f6140]
<FromGitter> <eliasjpr> So jennifer uses sam.cr for generating stuff
<FromGitter> <eliasjpr> one sec let me look for docs
<FromGitter> <johansmitsnl> I saw that, but it does nothing at all ⏎ ⏎ sam.cr: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5ba2a2f6913ba7799b14d992]
<FromGitter> <johansmitsnl> I took the sam code from the PR
<FromGitter> <eliasjpr> did you ran `crystal sam.cr -- generate:migration CreateContact`
<FromGitter> <eliasjpr> and then `crystal sam.cr -- db:setup` to run migrations
<FromGitter> <johansmitsnl> `crystal sam.cr -- generate:migration {YourModel}` I ran, and I would expect a migration file. But git st shows nothing new.
<FromGitter> <eliasjpr> Mmm
<FromGitter> <eliasjpr> Is it possible for you to share your project?
<FromGitter> <johansmitsnl> yes, one second
<FromGitter> <johansmitsnl> it is very bare at the moment
<FromGitter> <eliasjpr> Thats fine that will make it easier to debug
<FromGitter> <eliasjpr> k brb
<FromGitter> <eliasjpr> im gonna run the project locally
<FromGitter> <johansmitsnl> thnx
<FromGitter> <eliasjpr> Okay in `sam.cr` add this to the last line `Sam.help`
<FromGitter> <eliasjpr> It should look something like this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5ba2a64df4bd1056ac894123]
<FromGitter> <eliasjpr> I know `Sam.help` is not intuitive
<FromGitter> <eliasjpr> `Sam.run` would have been better :)
<FromGitter> <johansmitsnl> That did it, feeling so dump to have missed that
<FromGitter> <eliasjpr> ha! you don’t wanna know that stuff I have missed. It happens
<FromGitter> <eliasjpr> Jennifer feels so rails β™₯️
<feepbot> Awwwww!
<FromGitter> <eliasjpr> @johansmitsnl there is a nice guide for Jennifer don’t know if you saw it already https://imdrasil.github.io/jennifer.cr/docs/
<FromGitter> <johansmitsnl> @eliasjpr didn't found that one yet, reading it now
<FromGitter> <johansmitsnl> ```code paste, see link``` ⏎ ⏎ But PG does not suppor the length [https://gitter.im/amberframework/amber?at=5ba2aae5f7e1580625f64e1f]
<FromGitter> <eliasjpr> Length is nillable
<FromGitter> <eliasjpr> You can try `add_index(name : String, field : Symbol, type : Symbol, order : Symbol?, length : Int32?)` separately
<FromGitter> <johansmitsnl> `t.add_index(name: "nodes_uuid_index", field: :uuid, type: :uniq, order: :asc, length: nil)` ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Did I wrote it correctly? [https://gitter.im/amberframework/amber?at=5ba2ac8e1ee2ca65023ebf54]
<FromGitter> <eliasjpr> You should be able to do ⏎ ⏎ ```t.add_index(name: "nodes_uuid_index", field: :uuid, type: :uniq, order: :asc)``` [https://gitter.im/amberframework/amber?at=5ba2ae040cfe7f30f1bbaa8e]
<FromGitter> <eliasjpr> or ⏎ ⏎ ```t.add_index(name: "nodes_uuid_index", field: :uuid, type: :uniq, order: :asc, nil, nil)``` [https://gitter.im/amberframework/amber?at=5ba2ae22913ba7799b1521fc]
<FromGitter> <johansmitsnl> Both don't work. ⏎ ⏎ `t.add_index(name: "nodes_uuid_index", field: :uuid, type: :uniq, order: :asc)`: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5ba2aea2a56b215c9761c326]
<FromGitter> <johansmitsnl> To me it seems right but don't see what I'm missing here
<FromGitter> <eliasjpr> This is beyong my expertise with Jennifer. I would suggest to reach out to the creator @imdrasil
<FromGitter> <eliasjpr> he might shed some light on the issue.
<FromGitter> <eliasjpr> Maybe opening an issue on the Jennifer repo will get his attention
<FromGitter> <johansmitsnl> πŸ‘
<FromGitter> <johansmitsnl> @eliasjpr created an issue https://github.com/imdrasil/jennifer.cr/issues/166
<FromGitter> <johansmitsnl> But when added a migration I have to create the model manually ?
<FromGitter> <eliasjpr> yes, this is because jennfer is not supported as a default model
<FromGitter> <eliasjpr> if you would like I would recommend for you to use the default model `Granite` until the Jennifer recipe gets merged. The jennifer recipe will allow for you to use amber and jennifer more seamlessly
<FromGitter> <johansmitsnl> Ok, I started switching to `Granite` because I'm not used to write queries anymore. and ActiveRecord spoiled me (I noticed)
<FromGitter> <eliasjpr> You will feel right at home in a couple of key strokes
<FromGitter> <johansmitsnl> `Jennifer` will be more embedded in the `Amber` project if I understood it correctly?
<FromGitter> <eliasjpr> It would be supported via the recipe.
<FromGitter> <eliasjpr> we will not be mainting/supporting the Jennifer integration. The community will
marenz has quit [Ping timeout: 252 seconds]