• Stars
    star
    212
  • Rank 186,122 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Deno + PostgreSQL = DenoGres

Welcome to DenoGres! A new comprehensive ORM for PostgreSQL and Deno.

Getting Started

To begin, let's download DenoGres! Execute the below in the terminal - this will give you access to DenoGres's CLI functionality.

deno install --allow-read --allow-write --allow-net --allow-env --allow-run --name denogres https://deno.land/x/denogres/mod.ts

After installation is complete, following the instructions in your terminal to ensure DenoGres is added to PATH.

Quick Start

Before using DenoGres in a project, run the command below.

denogres --init

This will create the following in your project's root directory:

  • .env file for your database connection URI
  • a models folder for your model.ts file
  • a Migrations folder for migration logs and model snapshots

After running the init command, update the .env file to contain your database's connection URI.

DATABASE_URI=driver://user:password@host:port/database_name

With all the set-up steps complete, you're ready to introspect your database! Database introspection will automatically create TypeScript models of your database tables in the .models/model.ts file.

denogres --db-pull

Synchronizing your Database

Denogres features bi-directional synchronization that is designed to ensure that your database schema and your project Models in full alignment, maintaining a single, consistent source of truth.

To introspect and generate the associated models within the model.ts file, execute the the following CLI command:

denogres --db-pull

In addition to --db-pull, Denogres also includes --db-sync functionality that will revise the PostgreSQL schema to reflect changes within the DenoGres model.ts file.

Once completed changes to your model have been made, execute the following CLI command:

denogres --db-sync

Seeding Your Database

DenoGres allows data to be populated to the PostgreSQL schema through data seeding. This is primarily useful during database design/development (i.e. an application requires a certain amount of data to function properly) Create a seed.ts within the project root directory, and execute the following CLI command:

denogres --db-seed

The associated database schema will be pre-populated based on the user's seed.ts file.

Navigating the GUI

DenoGres includes a GUI that allows the user to test and run queries utilizing generated Models and associated methods. Furthermore, users can save database connections and previous queries to their accounts for later access.

Launch the DenoGres GUI by running the following CLI command:

denogres --gui

Migration Logs and Restore

Any time a user opts to make a request for --db-pull or --db-sync, Denogres maintains a record of that request so that users can refer back to those historical records. Additionally, users can opt to restore the Model/database schema to prior iterations, in instances where users would like to roll back/forward changes that have been made.

To see a historical list of migration logs, execute the following CLI command:

denogres --log

To restore Models to a prior version, execute the following CLI command:

denogres --restore [PREVIOUS_MODEL_FOLDER]

Testing

For develpers interested in contributing, to run all tests, use the command:

deno task test

Note: integration tests will require environment variable ENVIRONMENT set to test as well as a TEST_DB_URI.

Under Development

DenoGres is continually evolving. Features currently in development include:

  • Database sync method (denogres --db-sync) will account for multiple associations and composite unique keys.
  • "Compare" command (denogres --compare) will be implemented to display side-by-side diff between previous models.
  • A setter method will be appended to a model when an association is established with another model.
  • The manyToMany function will create a new join table.
  • Migrations log will be visible within the GUI, so that users can track/view/compare model versions.
  • Two-way ERD that allows users to change relational data that is then reflected onto their actual database
  • Additional support for MySQL, SQL Server, etc.
  • A Diagram page will offer a live ERD to visualize the user's database (see preview below)

Documentation

More information on how to use DenoGres and leverage all its wonderful abstraction functionality can be found here: https://denogres.deno.dev/

Contributors

Version 4.0

Version 3.0

Version 2.0

Version 1.0

License

MIT

More Repositories

1

Svelvet

πŸŽ› A Svelte library for building dynamic, infinitely customizable node-based user interfaces and flowcharts
Svelte
2,540
star
2

OverVue

Prototyping Tool For Vue Devs ι€‚η”¨δΊŽVueηš„εŽŸεž‹ε·₯ε…·
Vue
2,463
star
3

Reactime

Developer tool for time travel debugging and performance monitoring in React applications.
TypeScript
2,165
star
4

PreVue

🎨 All in One Prototyping Tool For Vue Developers.
Vue
1,389
star
5

Spearmint

Testing, simplified. || An inclusive, accessibility-first GUI for generating clean, semantic Javascript tests in only a few clicks of a button.
TypeScript
1,289
star
6

SvelteStorm

SvelteStorm is an open-source IDE with a built-in Debugging window for viewing and debugging your Svelte project in real-time
Svelte
1,007
star
7

Swell

Swell: API development tool that enables developers to test endpoints served over streaming technologies including Server-Sent Events (SSE), WebSockets, HTTP2, GraphQL, gRPC, and tRPC..
JavaScript
980
star
8

Docketeer

A Docker & Kubernetes developer tool to manage containers & visualize both cluster and container metrics
TypeScript
862
star
9

Chronos

πŸ“Š πŸ“Š πŸ“Š Monitors the health and web traffic of servers, microservices, Kubernetes/Kafka clusters, containers, and AWS services with real-time data monitoring and receive automated notifications over Slack or email.
TypeScript
829
star
10

obsidian

GraphQL, built for Deno - a native GraphQL caching client and server module
TypeScript
751
star
11

Recoilize

A Chrome Dev tool for debugging applications built with the experimental Recoil.js state management library.
TypeScript
604
star
12

SeeQR

A database analytic tool that allows developers to compare the efficiency of different schemas and queries on a granular level to make better informed architectural decisions regarding SQL databases at various scales.
TypeScript
594
star
13

Quell

Quell is an easy-to-use, lightweight JavaScript library providing a client- and server-side caching solution for GraphQL. Use Quell to prevent redundant client-side API requests and to minimize costly server-side response latency.
TypeScript
578
star
14

vno

a build tool for compiling and bundling Vue single-file components
TypeScript
432
star
15

ReacType

Prototyping Tool for exporting React/Typescript Applications!
TypeScript
429
star
16

Chromogen

UI-driven Jest test-generation package for Recoil selectors and Zustand store hooks
TypeScript
280
star
17

dbSpy

Visualize, modify, and build your database with dbSpy! An open-source data modeling tool to facilitate relational database development.
TypeScript
263
star
18

obsidian-developer-tool

Developer tool for monitoring client cache performance for Obsidian 8.0
TypeScript
49
star
19

SeeQR-Web

A web-based database analytic tool that allows a developer to compare the efficiency of different queries on a granular level to make better informed architectural decisions regarding Postgres databases at various scales.
TypeScript
15
star
20

Sveltestorm-Website

SvelteStorm website
Svelte
10
star
21

QuellDemo

Demo for Quell written in React utilizing Material UI, chartJS, redis, and graphQL.
TypeScript
7
star
22

reactime-web

Web page for Reactime
JavaScript
6
star
23

Reactype-web

This is the ReacType Website created with Next.js and Typescript
TypeScript
5
star
24

SeeQR-Website

SeeQR's Website
TypeScript
3
star