Skip to content

Commit

Permalink
Merge pull request rsandor#9 from realistschuckle/master
Browse files Browse the repository at this point in the history
Added SQLite 3 Support With developmentseed/node-sqlite3
  • Loading branch information
rsandor committed Jun 10, 2012
2 parents 044a290 + 63f28a1 commit 8cdbfaf
Show file tree
Hide file tree
Showing 4 changed files with 273 additions and 25 deletions.
15 changes: 10 additions & 5 deletions README
Expand Up @@ -3,6 +3,8 @@ Migrate - A database agnostic migration system for Node.js

By Ryan Sandor Richards

SQLite 3 Contribution by Curtis Schlak

Introduction
--------------------------------------------------------------------------------
Migrate is a tool that allows you to define database schema migrations with
Expand All @@ -14,9 +16,10 @@ Requirements
--------------------------------------------------------------------------------
1. Node.js - http://github.com/ry/node
2. node-mysql - https://github.com/felixge/node-mysql
3. node-sqlite3 - https://github.com/developmentseed/node-sqlite3

Please note that at the current time we only support MySQL but other DBMS' are
on their way (next up: Postgres).
Please note that at the current time we only support MySQL and SQLite 3 but
other DBMS' are on their way (next up: Postgres).

Installation
--------------------------------------------------------------------------------
Expand All @@ -31,12 +34,14 @@ the directory where the migrate.js file resides.
The configuration file has the following keys:

* `dbms` - The database management system to use (currently we only support a
a value of `'mysql'`).
a value of either `'mysql'` or `'sqlite3'`).
* `migration_path` - Relative path to the directory in which migrations are
stored.
* `mysql` - Just a simple client configuration for mysql. Fill out your username,
password, and any other information needed to connect to the database via
node-mysql's `Client` class.
* `sqlite3` - Just a simple client configuration for SQLite 3. Fill out the
filename for the database to which you would like to connect.

How do I use migrate?
--------------------------------------------------------------------------------
Expand Down Expand Up @@ -258,8 +263,8 @@ Producing SQL:
Outtro
--------------------------------------------------------------------------------
So that about sums it up. Simple and easy ;). It's a very early alpha version so
please don't hate on only having MySQL support! If you have a feature request
feel free to send me a message and I'll try to get it in ASAP.
please don't hate on only having MySQL and SQLite 3 support! If you have a
feature request feel free to send me a message and I'll try to get it in ASAP.

Thanks!

Expand Down
15 changes: 10 additions & 5 deletions README.markdown
Expand Up @@ -3,6 +3,8 @@ Migrate - A database agnostic migration system for Node.js

By Ryan Sandor Richards

SQLite 3 Contribution by Curtis Schlak

Introduction
--------------------------------------------------------------------------------
Migrate is a tool that allows you to define database schema migrations with
Expand All @@ -14,9 +16,10 @@ Requirements
--------------------------------------------------------------------------------
1. Node.js - http://github.com/ry/node
2. node-mysql - https://github.com/felixge/node-mysql
3. node-sqlite3 - https://github.com/developmentseed/node-sqlite3

Please note that at the current time we only support MySQL but other DBMS' are
on their way (next up: Postgres).
Please note that at the current time we only support MySQL and SQLite 3 but
other DBMS' are on their way (next up: Postgres).

Installation
--------------------------------------------------------------------------------
Expand All @@ -31,12 +34,14 @@ the directory where the migrate.js file resides.
The configuration file has the following keys:

* `dbms` - The database management system to use (currently we only support a
a value of `'mysql'`).
a value of either `'mysql'` or `'sqlite3'`).
* `migration_path` - Relative path to the directory in which migrations are
stored.
* `mysql` - Just a simple client configuration for mysql. Fill out your username,
password, and any other information needed to connect to the database via
node-mysql's `Client` class.
* `sqlite3` - Just a simple client configuration for SQLite 3. Fill out the
filename for the database to which you would like to connect.

How do I use migrate?
--------------------------------------------------------------------------------
Expand Down Expand Up @@ -258,8 +263,8 @@ Producing SQL:
Outtro
--------------------------------------------------------------------------------
So that about sums it up. Simple and easy ;). It's a very early alpha version so
please don't hate on only having MySQL support! If you have a feature request
feel free to send me a message and I'll try to get it in ASAP.
please don't hate on only having MySQL and SQLite 3 support! If you have a
feature request feel free to send me a message and I'll try to get it in ASAP.

Thanks!

Expand Down
34 changes: 34 additions & 0 deletions config.sqlite3.js
@@ -0,0 +1,34 @@
/*
* config.sqlite3.js - A database agnostic migration system for Node.js.
* Copyright (c) 2012 Curtis Schlak (https://github.com/realistschuckle)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

// Path to the migrations directory (relative to migrate)
exports.migration_path = './migrations/';

// Which DBMS to use for executing migrations
exports.dbms = 'sqlite3';

// Configuration for SQLite3 (filename, verbose)
exports.sqlite3 = {
filename: './another.something.sqlite3',
verbose: true
};

0 comments on commit 8cdbfaf

Please sign in to comment.