Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/auto-schema
Generate Redshift schemas from sample objects
https://github.com/segment-boneyard/auto-schema
Last synced: about 5 hours ago
JSON representation
Generate Redshift schemas from sample objects
- Host: GitHub
- URL: https://github.com/segment-boneyard/auto-schema
- Owner: segment-boneyard
- Created: 2014-03-07T23:45:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-04-25T15:23:46.000Z (over 10 years ago)
- Last Synced: 2024-10-28T16:59:55.703Z (18 days ago)
- Language: JavaScript
- Size: 221 KB
- Stars: 21
- Watchers: 40
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# auto-schema
Generate Redshift schemas from sample objects.
## Installation
```
$ npm install auto-schema
```## Example
```js
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:
```js
{ '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