@phyng/typeschema
v0.0.2
Published
A database schema definition library using TypeScript or JSON
Readme
TypeSchema
A database schema definition library using TypeScript or JSON
install
# use pnpm
pnpm add @phyng/typeschema
# or use npm
npm install @phyng/typeschemaUsage
import { Db, Table, Field } from '@phyng/typeschema'
const db = Db([
Table('user', [
Field('id', 'int', { pk: true, increment: true }),
Field('username', 'string'),
Field('name', 'string', { null: true }),
]),
Table('post', [
Field('id', 'int', { pk: true, increment: true }),
Field('name', 'string'),
Field('content', 'string'),
]),
])
export default dbLicense
This project is licensed under the MIT License - see the LICENSE file for details.
