0.0.14 • Published 3 years ago

@fastcampus/fastdao v0.0.14

Weekly downloads
599
License
MIT
Repository
github
Last release
3 years ago

fastdao

fast and simple dao using knex

npm version

Getting Started

// const = { connect, CrudOperations } = require('@fastcampus/fastdao');
import { connect, CrudOperations } from '@fastcampus/fastdao';

const knex = connect({ ...  });
// to use a separated connection for select
const knexReplica = connect({ ...  });
const postCrud = CrudOperations.create({ knex, knexReplica, table: 'post' });
await postCrud.select({ ... });
await postCrud.selectFirst({ ... });
await postCrud.selectById(1);
await postCrud.count({ ... });
await postCrud.exist({ ... });
await postCrud.insert({ ... });
await postCrud.update({ ... });
await postCrud.updateById(id, { ... });
await postCrud.delete({ ... });
await postCrud.deleteById(id);
await knex.transaction(async (tx) => {
  await postCrud.transacting(tx).insert(...);
  await postCrud.transacting(tx).updateById(...);
  await postCrud.transacting(tx).deleteById(...);
});

Contributing

test

$ npm test

build

$ npm run build

watch(continuous build)

$ npm start

may the SOURCE be with you...

0.0.14

3 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago