0.0.14 • Published 1 year ago

effect-drizzle v0.0.14

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

effect-drizzle

Integrates drizzle-orm and @effect.

⚠️ Under development, working on PostgreSQL right now. Will add SQLite and MySQL (maybe more) when the PostgreSQL API is stable.

Example

import { InferModel } from "drizzle-orm"
import {
  db,
  pgTable,
  serial,
  text,
  runQuery,
  runQueryOne
} from "effect-drizzle/pg"

const posts = pgTable("posts", {
  id: serial("id").primaryKey(),
  name: text("title").notNull(),
});

type Post = InferModel<typeof posts>;

const post1 = runQuery(db.select.from(posts));
//    ^ Effect<PgConnection, PgError, Post>

const post2 = runQueryOne(db.select.from(posts));
//    ^ Effect<PgConnection, PgError | NotFound, Post>

const post3 = runQueryExactlyOne(db.select.from(posts));
//    ^ Effect<PgConnection, PgError | NotFound | TooMany, Post>
0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago