New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

taike

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

taike

generate node-sql columns from a schema

latest
Source
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

Taike Build Status

Schema generator for node-sql.

npm install taike

Example

Taike lets you write schemas like:

var schema = require('taike');
var τ = schema.decorators;
var sql = require('sql');

var Post = sql.define('posts', {
  columns: schema({
    id:      τ.id('integer'),
    title:   τ.size(255, String),
    content: String
  })
});

API

Properties

A property is an object key with a specification value. A spec can be a raw type, or as object containing any of:

type

The data type.

size

A String column is either text or, if size is present, varchar(size).

primary, required, unique, autoincrement

If true, modify the column type as appropriate. If primary is present, required and unique are ignored.

column

Change the column name, if you want it to have a different name to the property.

Types

For now, Taike only supports basic String, Number and Boolean columns. Foreign keys will arrive in a future version.

Decorators

Building spec objects can be tedious. Taike provides composable decorators for attaching spec properties. The following properties are available under taike.decorators: primary, required, unique, autoincrement, column and size.

Licence

MIT

Keywords

sql

FAQs

Package last updated on 17 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts