padrino-framework icon indicating copy to clipboard operation
padrino-framework copied to clipboard

Creating databases without invoking binaries

Open Quintasan opened this issue 7 years ago • 3 comments

Currently when you create a new Padrino project with PostreSQL adapter when you try to create or drop the database it tries to call createdb or dropdb binary as seen in padrino-gen/padrino-tasks/sql-helpers.rb.

While this works in general it's pretty useless when the database sits in a container (Docker for example). I know that ActiveRecord does this without relying on binaries. Would it be possible to replicate this in Padrino so we don't rely on binaries?

Quintasan avatar Jun 28 '17 19:06 Quintasan

Pretty sure since ActiveRecord 4 the given DB's binaries are used for dumping.

With MySQL for example, triggers were not dumped until they moved to mysqldump. Situation may have been similar for PostreSQL, but I don't use it so not sure. 😳

sshaw avatar Jun 28 '17 21:06 sshaw

@sshaw For dumping? Maybe. For creating the database - definitely not since I can use Rails with Postgres in Docker OOB provided I setup the right credentials in configuration.

Quintasan avatar Jun 28 '17 21:06 Quintasan

For dumping? Maybe. For creating the database - definitely not since

Ah yes, you're correct.

sshaw avatar Jun 28 '17 21:06 sshaw