Giter Site home page Giter Site logo

drizzle-test's Introduction

Sample Project to Play with Drizzle ORM

This is a little toy project I created to play a little bit with Drizzle ORM, and see if it really is as easy and simple to work with as it looks.

Rational for Choosing Drizzle

I evaluated the following ORMs:

Eventually settling on Drizzle for the following reasons:

  • light-weight implementation (has zero external dependencies)
  • simple, concise model definition
  • low-friction migrations
  • offers both a SQL query interface and an ORM "Query" interface
  • easy typing

It does have a few downsides:

  • There isn't a command to just "set it up for you" - not a big deal since I just put this together in a couple of hours
  • Objection seems like it might handle validation of nested JSON objects a little better
  • You need to speficially declare your models for your Data Store - so if you are putting together a project that is SQLite for local dev, but Postgres in production, this isn't for you.
  • the ORM "Query" ergonomics could be improved a little (mostly thinking of the where), the SQL backend shows through a little here.

Requirements:

  • NodeJs 18 or higher
  • yarn
  • Docker and Docker Compose

Yarn Commands:

  • yarn db:start - spins up the docker instance with Postgres
  • yarn db:stop - shuts that instance down
  • yarn db:generate - automatically generates a migration file for you based on changes to your models
  • yarn db:migrate - runs migrations to update your database
  • yarn db:seed - takes dummy data, generates it, and inserts it into the database.
  • yarn db:studio - starts up Drizzle Studio - a simple UI for browsing your database, and making small changes.
  • yarn dev - just runs the simple test file in index.ts

drizzle-test's People

Contributors

ebetancourt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.