lovelysystems / loopback-connector-crateio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

loopback-connector-crateio

Please note that this package is in a very early state and is experimental.

loopback-connector-crate is the Crate connector module for loopback-datasource-juggler.

It is derived from the mysql implementation at loopback-connector-mysql

Installation

npm install loopback-connector-crateio --save

Basic use

To use it you need loopback-datasource-juggler.

  1. Setup dependencies in package.json:
{
  ...
  "dependencies": {
    "loopback-datasource-juggler": "latest",
    "loopback-connector-crateio": "latest"
  },
  ...
}
  1. Use:
var DataSource = require('loopback-datasource-juggler').DataSource;
var dataSource = new DataSource('crateio', {
  host: 'localhost',
  port: 4200
});

Crate Features

Models can be defined with object properties:

var ModelWithSchemaObject = db.define('ModelWithSchemaObject', {
  o: {
    type: Object,
    policy: 'STRICT',
    schema: 'ObjectModel'
  }
});

Limitations

alterTable can only add/create new properties.

It is not possible to create indices.

Testing

To run tests a instance crate must be running on port 4200.

Simplest way to install and run crate:

bash -c "$(curl -L try.crate.io)"

About

License:MIT License


Languages

Language:JavaScript 99.5%Language:Makefile 0.5%