0.3.2 • Published 10 years ago

auto-schema v0.3.2

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

auto-schema

Generate Redshift schemas from sample objects.

Installation

$ npm install auto-schema

Example

var autoschema = require('auto-schema');

var schema = autoschema({
  user: {
    id: 123242123,

    name: {
      first: 'tobi',
      last: 'loki'
    },

    properties: {
      category: 'Buttons',
      label: 'Login'
    },

    context: {
      userAgent: 'Mozilla whatever'
    }
  }
});

console.log(schema);

yields:

{ 'user.id': 'float',
  'user.name.first': 'varchar(2048)',
  'user.name.last': 'varchar(2048)',
  'user.properties.category': 'varchar(2048)',
  'user.properties.label': 'varchar(2048)',
  'user.context.userAgent': 'varchar(2048)' }

License

MIT

0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.0.1

10 years ago