0.0.14 • Published 2 years ago

effect-drizzle v0.0.14

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago