Skip to content

PeterZainzinger/electric-drizzle

Repository files navigation

ElectricDrizzle

This is a proof of concept using drizzle-orm with electric-sql.

The structure of the project is as follows:

  • A code generator for drizzle in apps/electric_drizzle-generator
  • A small react library in libs/electric-drizzle-react
  • An example with nextjs in apps/electric_drizzle

What works

  • Code generator that outputs a reasonable amount of code and is also readable
  • No coupling between server orm and client drizzle code
  • Basic drizzle queries work (select, insert, update, delete)
  • Relational queries work
  • live queries work, relation and normal ones

Limitations

  • no special datatype handling (bool to int version, date versions etc)
  • some gaps in the typing for relational queries
  • code in a rough state, just a proof of concept
  • relation are all interpreted as one to many
  • "UI" really basic
  • relational query not updating, seems like an electric bug not working with sub queries

Setup

Install dependencies

yarn

Start services

docker compose start

docker compose -f apps/electric-drizzle/backend/docker-compose.yml up -d

Run the migrations

npx nx run electric-drizzle:migrate

Start next dev server

npx nx run electric-drizzle:serve:development

App should be available at http://localhost:4200

Code generation

npx nx run electric-drizzle-generator:run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published