Project

sqldef

0.0
No release in over 3 years
Low commit activity in last 3 years
Idempotent MySQL/PostgreSQL schema management by SQL
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

 Project Readme

sqldef-ruby

Ruby interface to call sqldef.

Installation

gem 'sqldef'

Usage

Download

You can download mysqldef, psqldef, or sqlite3def.

Sqldef.bin = './bin'
Sqldef.download(:psqldef)

download is automatically executed by the following methods too.

Export

You can export the database schema to a file.

Sqldef.export(
  command:  :psqldef,
  host:     host,
  port:     port,
  user:     user,
  password: password,
  database: database,
  path:     'db/schema.sql',
)

Dry Run

You can show DDLs to be executed.

Sqldef.dry_run(
  command:  :psqldef,
  host:     host,
  port:     port,
  user:     user,
  password: password,
  database: database,
  path:     'db/schema.sql',
)

Apply

You can run DDLs to match the schema.

Sqldef.apply(
  command:  :psqldef,
  host:     host,
  port:     port,
  user:     user,
  password: password,
  database: database,
  path:     'db/schema.sql',
)

License

The gem is available as open source under the terms of the MIT License.