1.0.6 • Published 4 years ago

krc-dbcontext v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

krc-dbcontext

Define common Repository pattern for database bridge by KrakenUI team!

NPM version npm download

SUPPORT DB ENGINES

  • PostgreSQL

HOW IT WORKS

install package

krc-dbcontext

npm install --save krc-dbcontext

usage

   import { connectPgDatabase, BaseModel } from "krc-dbcontext";

    const factory = await connectPgDatabase();
    const productRegister = factory.register<string, Product>(
        Product,
        "products"
    );

    const productRepository = productRegister.instance;

    const p = await productRepository.insert({
        id: Date.now(),
        name: "Product new 1",
        note: "",
    });

API references

ENV

NameargsDescription
PG_DB_HOSTstringDB host address
PG_DB_NAMEstringDB name
PG_DB_USERstringDB login user
PG_DB_PASSWORDstringDB login password
PG_DB_PORTnumberDB working port
PG_MAX_POOLnumberMaximum connection pool

License

krc-dbcontext is released under the MIT license.

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago