https://github.com/drsensor/js-data-autosql
This is workaround enhancement for js-data-sql
https://github.com/drsensor/js-data-autosql
Last synced: 8 months ago
JSON representation
This is workaround enhancement for js-data-sql
- Host: GitHub
- URL: https://github.com/drsensor/js-data-autosql
- Owner: DrSensor
- License: mit
- Created: 2017-11-26T21:01:17.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-16T23:36:16.000Z (about 8 years ago)
- Last Synced: 2025-03-10T19:57:17.636Z (over 1 year ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# js-data-autosql (WIP)
This is workaround enhancement for js-data-sql
## How to use
```javascript
import { SqlAdapter } from 'js-data-autosql'
let adapter = new SqlAdapter({
knexOpts: {
client: 'sqlite3',
connection: {
filename: './data.db'
},
useNullAsDefault: true
},
auto: {
timestamp: true, // default is true
alterTable: true, // default is true
arrayAs: {
type: 'string', // the options is string and json
delimiter: '\t'
}
}
})
```
## Feature
- [x] Auto create table
- [ ] Auto alter table
- [x] add column
- [ ] drop column
- [ ] Auto convert unsupported data type (useful when store array in sqlite or db that not support array)
- [ ] as string (WIP)
- [ ] as json[] or jsonb[]
- [x] Auto create timestamp (`created_at` and `updated_at`) in ISO format
- [ ] Auto create relationship (Foreign Key, etc)
- [x] 1:1
- [x] 1:M
- [ ] [Tested](https://github.com/js-data/js-data-adapter-tests)
## License
[MIT](./LICENSE)