No description
Find a file
dave caruso 637132d090 stuff
2021-03-18 21:35:35 -04:00
src stuff 2021-03-18 21:35:35 -04:00
.gitignore stuff 2021-03-18 21:35:35 -04:00
package.json v1.0.2 2021-03-18 21:35:26 -04:00
readme.md stuff 2021-03-18 21:35:35 -04:00
rollup.config.js stuff 2021-03-18 21:35:35 -04:00
tsconfig.json stuff 2021-03-18 21:35:35 -04:00
yarn.lock stuff 2021-03-18 21:35:35 -04:00

no-mysql

Mysql in a nosql fashion, with very strong TypeScript typings.

import { Database, DbTableValue, TableValue } from './src'

const db = new Database(
  {
    database: 'db',
    host: 'club',
    user: 'dave',
  },
  {
    people: {
      id: 'primary int',
      name: ['varChar', 100],
      born: 'optional date',
    },
    numbers: {
      id: 'primary int',
      coolness: 'int',
    }
  }
)

type PeopleEntry = DbTableValue<typeof db, 'people'>;
type NumbersEntry = DbTableValue<typeof db, 'numbers'>;

db.people.insert({
  id: 231,
  name: 'hello',
  // born: new Date(), // optional
})

We wrote this one day then forgot to add half the feature or write docs, so the above example is all you get until we update it again to add more features, fix bugs. Not all Mysql Types are yet supported.