Skip to content

Update README.md #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 32 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
# loopback-connector-sqlite3

The official SQLite3 connector module for the LoopBack framework.
[SQLite](https://sqlite.org/) is a self-contained, high-reliability, embedded, full-featured, public-domain, SQL database engine. This is the official SQLite3 connector module for the LoopBack framework.

## Connector settings
## Installation

The connector can be configured using the following settings from the data source.
* file: The path to the database file or `:memory:`
* debug (default to false)
Enter the following in the top-level directory of your LoopBack application:

The SQLite3 connector uses [node-sqlite3](https://github.com/mapbox/node-sqlite3) as the driver.
```
$ npm install loopback-connector-sqlite3 --save
```

The `--save` option adds the dependency to the application's `package.json` file.

## Connector settings

## Discovering Models
Configure the connector with the following data source properties:

The SQLite3 connector does not currently support discovery of models.
* `file`: The path to the database file or `:memory:`
* `debug`: Display debug information. Default is false.

The SQLite3 connector uses [node-sqlite3](https://github.com/mapbox/node-sqlite3) as the driver.

## Model definition for SQLite3

Expand Down Expand Up @@ -76,23 +83,25 @@ The model definition consists of the following properties:

## Type Mapping

- Number
- Primary key is stored as INTEGER
- Others are stored as REAL
- Boolean
- Stored as INTEGER 1 or 0
- Date
- Stored as INTEGER (Millis since Jan 01 1970 00:00:00 0000)
- String
- Complex types (GeoPoint, Point, List, Array, Object, Sub-models)
- Stored as TEXT in JSON form
- JSON
- Stored as TEXT

SQLite3 does not enforce types. I.e. any data can be stored in any column regardless of definiton.
| LoopBack type | Mapped to SQLite3 type |
|-----|-----|
| Number| Primary key stored as INTEGER, others as REAL |
| Boolean | INTEGER 1 or 0 |
| Date | INTEGER (ms since Jan 01 1970 00:00:00 0000) |
| String | ? |
| Complex types: GeoPoint, Point, List, Array, Object, and sub-models | TEXT in JSON format |
| JSON | TEXT |

SQLite3 does not enforce types. Any data can be stored in any column regardless of definiton.
This connector attempts to check for invalid Date, Number and JSON types.

## Auto Migrate / Auto Update
## Unsupported features

### Discovering Models

The SQLite3 connector does not currently support model discovery.

### Auto Migrate / Auto Update

The SQLite3 connector does not currently support auto-migrate or auto-upgrade.

Expand Down