0.0.9 • Published 3 years ago

ormless v0.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Ormless

Ormless is inspired by Prisma2 and is built on a Typesafe SQL query builder called Kysely that aims to add useful shortcut functions with no fuss and no surprises, fully and automatically typed.

Features:

  • A command-line tool introspect SQL database and generate the data schema for tables, views, constraints and enums
  • Simple and fun way to select, insert, update and delete objects using the full power of SQL and Typescript

Installation

Ormless currently only works on postgres.

MySQL and sqlite support will be added once Kysely support them. Kysely also has a simple interface for third-party dialects.

if you only need both interfaces and shortcut functions.

npm install ormless@latest

if you only need interfaces only.

npx ormless@latest

** This library is still work in progress and so does Kysely.

Example

ormless.config.json

{
  "database": {
    "public": {
      "actor": {},
      "address": {},
      "category": {},
      "city": {},
      "country": {},
      "customer": {},
      "film": {},
      "film_actor": {},
      "film_category": {},
      "inventory": {},
      "language": {},
      "payment": {},
      "rental": {},
      "staff": {},
      "store": {}
    }
  },
  "paths": ["public"],
  "connection": {
    "database": "ormless",
    "host": "localhost",
    "user": "michael",
    "dialect": "postgres"
  },
  "generate": {
    "database": {
      "repository": true,
      "folder": "example"
    }
  }
}

Introspect Result

Usage

Build-in Shortcuts

  • selectOne
  • selectMany
  • createOne
  • createMany
  • updateOne
  • updateMany
  • deleteOne
  • deleteMany
0.0.3

3 years ago

0.0.2

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.1

3 years ago

1.0.0

3 years ago