<FromGitter>
<Blacksmoke16> another one for aggregate query `min, max, avg` coming soon
snsei has joined #amber
snsei has quit [Remote host closed the connection]
snsei has joined #amber
snsei has quit [Ping timeout: 250 seconds]
<FromGitter>
<charleystran> does anyone have advice or documentation on how to work with dates in forms? I tried to submit as '2018-11-10' but it didnt work
<FromGitter>
<naiyt> Hi! Just started playing around with Amber. Anybody know if there's been any work on a multi-tenancy shard, a la Apartment? https://github.com/influitive/apartment ⏎ ⏎ If not, I was thinking about taking a crack at writing one
<FromGitter>
<Blacksmoke16> not that im aware of
<FromGitter>
<Blacksmoke16> wait
<FromGitter>
<Blacksmoke16> what does that do?
<FromGitter>
<Blacksmoke16> just allow certain models to use diff db connections?
<FromGitter>
<naiyt> It helps you create and manage different database tenants. I've mainly used it with postgres, where the terminology is "schema", which is a bit confusing, but it's basically just another instance of your database that's been namespaced. Makes it easy to write an application that can sequester data based on accounts or organizations. That gem just does a few nice things, like create the extra schemas for you, run your
<FromGitter>
... migrations in all of them, and automatically switch schemas based on stuff like host name or subdomain or whatever
<FromGitter>
<naiyt> (I believe the MySQL implementation creates separate dbs, and then switches the connection for you, yeah)
<FromGitter>
<Blacksmoke16> yea i dont think crystal has anything like that atm?
<FromGitter>
<naiyt> Doesn't look like it, couldn't find anything from searching
<FromGitter>
<Blacksmoke16> which would be a basic implementation i guess?
snsei has joined #amber
<FromGitter>
<naiyt> Ah, interesting. Sort of a similar idea, although with something like apartment all of your models are still using the same adapter, but the actual database (or "schema") they're reading from will change based on the request
<FromGitter>
<naiyt> That is a cool feature though
<FromGitter>
<Blacksmoke16> i use 2 adapters that i have mapped to two diff schemas in pg
<FromGitter>
<Blacksmoke16> so in my model i could do `adapter schema1`
snsei has quit [Ping timeout: 252 seconds]
<FromGitter>
<Blacksmoke16> however its just a macro so i *guess* you could override the adapter based on some string match from ENV variable or whatever on init
<FromGitter>
<Blacksmoke16> issue you going to run into is making something that will work for every db ORM
<FromGitter>
<Blacksmoke16> vs in rails they just have to deal with AR
<FromGitter>
<Blacksmoke16> class variable i mean*
<FromGitter>
<charleystran> I just want to rebump how to work with dates in forms. What is the proper format to send dates to granite?
<FromGitter>
<Blacksmoke16> lets see
<FromGitter>
<Blacksmoke16> whats the error?
<FromGitter>
<charleystran> there is no error, it just doesnt save a value
<FromGitter>
<charleystran> in rails there is date helper for the view, but there is no documentation on the format that amber expects for a date field
<FromGitter>
<charleystran> I could translate and such, but I just dont know what to translate too
<FromGitter>
<Blacksmoke16> yea i dunno
<FromGitter>
<Blacksmoke16> doesnt save a value to db?
<FromGitter>
<Blacksmoke16> any error from db?
<FromGitter>
<Blacksmoke16> its prob coming thru as a string and you're trying to save a string to a datetime field in db