All Projects → city41 → Node Sql Fixtures

city41 / Node Sql Fixtures

Licence: mit
SQL fixtures for Node.js in PostgreSQL, MySQL, MariaDB and SQLite

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node Sql Fixtures

Blog
Everything about database,business.(Most for PostgreSQL).
Stars: ✭ 6,330 (+8228.95%)
Mutual labels:  database, mysql, postgresql
Dbmigrations
A library for the creation, management, and installation of schema updates for relational databases.
Stars: ✭ 67 (-11.84%)
Mutual labels:  database, mysql, postgresql
Database rewinder
minimalist's tiny and ultra-fast database cleaner
Stars: ✭ 685 (+801.32%)
Mutual labels:  database, mysql, postgresql
Dbshield
Database firewall written in Go
Stars: ✭ 620 (+715.79%)
Mutual labels:  database, mysql, postgresql
Eralchemy
Entity Relation Diagrams generation tool
Stars: ✭ 767 (+909.21%)
Mutual labels:  database, mysql, postgresql
Easydb
Easy-to-use PDO wrapper for PHP projects.
Stars: ✭ 624 (+721.05%)
Mutual labels:  database, mysql, postgresql
Scalikejdbc
A tidy SQL-based DB access library for Scala developers. This library naturally wraps JDBC APIs and provides you easy-to-use APIs.
Stars: ✭ 1,139 (+1398.68%)
Mutual labels:  database, mysql, postgresql
Qb
The database toolkit for go
Stars: ✭ 524 (+589.47%)
Mutual labels:  database, mysql, postgresql
Zabbixdba
Zabbix Database Monitoring Service (Oracle, Pg, MySQL, MS SQL, DB2, etc.)
Stars: ✭ 68 (-10.53%)
Mutual labels:  database, mysql, postgresql
Bookshelf
A simple Node.js ORM for PostgreSQL, MySQL and SQLite3 built on top of Knex.js
Stars: ✭ 6,252 (+8126.32%)
Mutual labels:  database, mysql, postgresql
Beekeeper Studio
Modern and easy to use SQL client for MySQL, Postgres, SQLite, SQL Server, and more. Linux, MacOS, and Windows.
Stars: ✭ 8,053 (+10496.05%)
Mutual labels:  database, mysql, postgresql
Hunt Entity
An object-relational mapping (ORM) framework for D language (Similar to JPA / Doctrine), support PostgreSQL and MySQL.
Stars: ✭ 51 (-32.89%)
Mutual labels:  database, mysql, postgresql
Typeorm
ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
Stars: ✭ 26,559 (+34846.05%)
Mutual labels:  database, mysql, postgresql
Laravel Db Snapshots
Quickly dump and load databases
Stars: ✭ 650 (+755.26%)
Mutual labels:  database, mysql, postgresql
Go Sqlbuilder
A flexible and powerful SQL string builder library plus a zero-config ORM.
Stars: ✭ 539 (+609.21%)
Mutual labels:  database, mysql, postgresql
Metabase
The simplest, fastest way to get business intelligence and analytics to everyone in your company 😋
Stars: ✭ 26,803 (+35167.11%)
Mutual labels:  database, mysql, postgresql
Backup
Easy full stack backup operations on UNIX-like systems.
Stars: ✭ 4,682 (+6060.53%)
Mutual labels:  database, mysql, postgresql
Adminer
Database management in a single PHP file
Stars: ✭ 4,999 (+6477.63%)
Mutual labels:  database, mysql, postgresql
Db Dumper
Dump the contents of a database
Stars: ✭ 744 (+878.95%)
Mutual labels:  database, mysql, postgresql
Goqu
SQL builder and query library for golang
Stars: ✭ 984 (+1194.74%)
Mutual labels:  database, mysql, postgresql

No longer supported

This module is now archived and no longer being updated

sql-fixtures

Easily generate data that gets saved in the database, with foreign key dependencies automatically resolved. Ideal for integration tests and generating dummy data. Uses knex internally.

Supported Databases

Database Works? As of version Integration Tests? Usage
Postgres Yes 0.0.0 Yes several projects known
MySQL Yes* 0.4.0 Yes several projects known
sqlite3 Yes* 0.3.0 Yes one known project
MariaDB Yes** 0.7.0 Yes no known projects :(

*For MySQL and Maria you can run into issues for tables that lack a singular primary key.

**For sqlite, you can hit the same issue as MySQL and Maria above if you create your tables using "without rowid"

Install

npm install sql-fixtures

Simple Example

var sqlFixtures = require('sql-fixtures');

// depending on which database engine you are using
// this is a typical PostgreSQL config for the pg driver
var dbConfig = {
  client: 'pg',
  connection: {
    host: 'localhost',
    user: 'testdb',
    password: 'password',
    database: 'testdb',
    port: 15432
  }
};

var dataSpec = {
  users: {
    username: 'Bob',
    email: '[email protected]'
  }
};

sqlFixtures.create(dbConfig, dataSpec, function(err, result) {
  // at this point a row has been added to the users table
  console.log(result.users[0].username);
});

Documentation and Examples

Are available at the sql-fixtures website

Contributing

NOTE: I am hesitant to add more features at this point. I feel sql-fixtures is feature complete now and I want to keep it a small, focused module. If you have an idea for a feature you want to implement, please contact me first.

Please fork and send pull requests in the typical fashion.

There are both unit and integration tests. The unit tests are invoked with gulp test:unit.

Checkout integration_tests.md for the scoop on the integration tests.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].