GithubHelp home page GithubHelp logo

andrewjo / sails-sqlite3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from balderdashy/sails-adapter-boilerplate

24.0 5.0 16.0 158 KB

SQLite3 adapter for Sails.js

Home Page: http://sailsjs.com

JavaScript 99.47% Makefile 0.53%

sails-sqlite3's Introduction

image_squidhome@2x.png

SQLite3 Sails/Waterline Adapter

A Waterline adapter for SQLite3. May be used in a Sails app or anything using Waterline for the ORM.

Disclaimers

  • SQLite3 adapter is not optimized for performance. Native joins are not implemented (among other issues).
  • This codebase contains no unit tests, though all integration tests with the waterline api (v1) pass. (See below for supported interfaces)

People who can use this package as is:

Those prototyping apps with sailsjs 1.x and looking to use sqlite for a test database.

For anyone looking to use this adapter in production, contributions welcome!

Getting started

To use this in your sails app, install using:

npm install --save sails-sqlite3

In your config\datastores.js file, add a property with your datastore name. Supported configuration:

default: {
  adapter: 'sails-sqlite3',
  filename: '[YOUR DATABASE].db',
  mode: sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE,
  verbose: false
}

For more information on the mode configuration property, see the driver documentation.

Example with Modes

To use different database modes, import the sqlite3 module, which is a dependency of this pacakge:

const sqlite3 = require('sqlite3');

const config = {
  filename: 'testdb.db',
  mode: sqlite3.OPEN_READONLY,
  verbose: true
};

Testing

npm test

Currently only waterline-adapter-tests are hooked up. Passing interfaces:

  • semantic
  • queryable
  • associations
  • migratable

Acknowledgements

This is a rewrite from a fork of the sails-sqlite3 adapter written for sailsjs < 1.0.0 originally by Andrew Jo. I borrowed most of the structure of the code and a lot of the sql querying from the original codebase.

About Sails.js and Waterline

http://SailsJs.com

Waterline is a new kind of storage and retrieval engine for Sails.js. It provides a uniform API for accessing stuff from different kinds of databases, protocols, and 3rd party APIs. That means you write the same code to get users, whether they live in mySQL, LDAP, MongoDB, or Facebook.

sails-sqlite3's People

Contributors

andrewjo avatar dasilva333 avatar kcappieg avatar mikermcneil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.