|
1 | | - |
2 | | -Welcome to DenoGres! A new comprehensive ORM for PostgreSQL and Deno. |
| 1 | + Welcome to DenoGres! A new comprehensive ORM for |
| 2 | +PostgreSQL and Deno. |
3 | 3 |
|
4 | 4 | ## Getting Started |
5 | | -To begin, let's download DenoGres! Execute the below in the terminal - this will give you access to DenoGres's CLI functionality. |
6 | | ->`deno install --allow-read --allow-write --allow-net --allow-env --name denogres https://deno.land/x/denogres/mod.ts` |
| 5 | + |
| 6 | +To begin, let's download DenoGres! Execute the below in the terminal - this will |
| 7 | +give you access to DenoGres's CLI functionality. |
| 8 | + |
| 9 | +> `deno install --allow-read --allow-write --allow-net --allow-env --allow-run --name denogres https://deno.land/x/denogres/mod.ts` |
7 | 10 |
|
8 | 11 | After installation is complete, ensure deno is added to PATH. |
9 | 12 |
|
| 13 | +## Quick Start |
| 14 | + |
| 15 | +Before using DenoGres in a project, run the command below. |
| 16 | + |
| 17 | +> `denogres --init` |
| 18 | +
|
| 19 | +This will create the following in your project's root directory: |
| 20 | + |
| 21 | +- .env file for your database connection URI |
| 22 | +- a models folder for your model.ts file |
| 23 | +- a Migrations folder for migration logs and model snapshots |
| 24 | + |
| 25 | +After running the init command, update the .env file to contain your database's |
| 26 | +connection URI. |
| 27 | + |
| 28 | +> `DATABASE_URI=driver://user:password@host:port/database_name` |
| 29 | +
|
| 30 | +With all the set-up steps complete, you're ready to introspect your database! |
| 31 | +Database introspection will automatically create TypeScript models of your |
| 32 | +database tables in the .models/model.ts file. |
| 33 | + |
| 34 | +> `denogres --db-pull` |
| 35 | +
|
| 36 | +## Synchronizing your Database |
| 37 | + |
| 38 | +Denogres features bi-directional synchronization that is designed to ensure that |
| 39 | +your database schema and your project Models in full alignment, maintaining a |
| 40 | +single, consistent source of truth. |
| 41 | + |
| 42 | +To introspect and generate the associated models within the model.ts file, |
| 43 | +execute the the following CLI command: |
| 44 | + |
| 45 | +> `denogres --db-pull` |
| 46 | +
|
| 47 | +In addition to --db-pull, Denogres also includes --db-sync functionality that |
| 48 | +will revise the PostgreSQL schema to reflect changes within the DenoGres |
| 49 | +model.ts file. |
| 50 | + |
| 51 | +Once completed changes to your model have been made, execute the following CLI |
| 52 | +command: |
| 53 | + |
| 54 | +> `denogres --db-sync` |
| 55 | +
|
| 56 | +## Seeding Your Database |
| 57 | + |
| 58 | +DenoGres allows data to be populated to the PostgreSQL schema through data |
| 59 | +seeding. This is primarily useful during database design/development (i.e. an |
| 60 | +application requires a certain amount of data to function properly) Create a |
| 61 | +seed.ts within the project root directory, and execute the following CLI |
| 62 | +command: |
10 | 63 |
|
11 | | -## Using DenoGres |
12 | | -Before using DenoGres in a project, run the below. |
13 | | -In your project's root directory, a .env file, for your database connection URI, and a models folder, for your model.ts file, will be created. |
14 | | ->`denogres --init` |
| 64 | +> `denogres --db-seed` |
15 | 65 |
|
16 | | -After running the init command, update the .env file to contain your database's connection URI. |
17 | | ->`DATABASE_URI=driver://user:password@host:port/database_name` |
| 66 | +The associated database schema will be pre-populated based on the user's seed.ts |
| 67 | +file. |
18 | 68 |
|
19 | | -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. |
20 | | ->`denogres --db-pull` |
| 69 | +## Navigating the GUI |
21 | 70 |
|
22 | | -### Under Development |
23 | | -DenoGres includes some functionality that is still in development - including database sync functionality. The sync functionality: |
24 | | - * Identifies instances within the models/model.ts file where user updates have caused the database and TypeScript models to be out-of-sync |
25 | | - * Creates and executes queries to update the database so all points of reference once again align |
26 | | ->`denogres --db-sync` |
| 71 | +DenoGres includes a GUI that allows the user to test and run queries utilizing |
| 72 | +generated Models and associated methods. Furthermore, users can save database |
| 73 | +connections and previous queries to their accounts for later access. |
27 | 74 |
|
28 | | -## Documents |
29 | | -More information on how to use DenoGres and leverage all its wonderful abstraction functionality can be found here: https://denogres.deno.dev/ |
| 75 | +Launch the DenoGres GUI by running the following CLI command: |
| 76 | + |
| 77 | +> `denogres --gui` |
| 78 | +
|
| 79 | +## Migration Logs and Restore |
| 80 | + |
| 81 | +Any time a user opts to make a request for --db-pull or --db-sync, Denogres |
| 82 | +maintains a record of that request so that users can refer back to those |
| 83 | +historical records. Additionally, users can opt to restore the Model/database |
| 84 | +schema to prior iterations, in instances where users would like to roll |
| 85 | +back/forward changes that have been made. |
| 86 | + |
| 87 | +To see a historical list of migration logs, execute the following CLI command: |
| 88 | + |
| 89 | +> `denogres --log` |
| 90 | +
|
| 91 | +To restore Models to a prior version, execute the following CLI command: |
| 92 | + |
| 93 | +> `denogres --restore [PREVIOUS_MODEL_FOLDER]` |
| 94 | +
|
| 95 | +## Under Development |
| 96 | + |
| 97 | +DenoGres is continually evolving. Features currently in development include: |
| 98 | + |
| 99 | +- Database sync method (`denogres --db-sync`) will account for multiple |
| 100 | + associations and composite unique keys. |
| 101 | +- "Compare" command (`denogres --compare`) will be implemented to display |
| 102 | + side-by-side diff between previous models. |
| 103 | +- Migrations log will be visible within the GUI, so that users can |
| 104 | + track/view/compare model versions. |
| 105 | +- ERD-style diagrams will be generated within the GUI, so users can have a |
| 106 | + comprehensive view of the data model. |
| 107 | +- Additional support for MySQL, SQL Server, etc. |
| 108 | + |
| 109 | +## Documentation |
| 110 | + |
| 111 | +More information on how to use DenoGres and leverage all its wonderful |
| 112 | +abstraction functionality can be found here: https://denogres.deno.dev/ |
| 113 | + |
| 114 | +## Contributors |
| 115 | + |
| 116 | +### Version 2.0 |
| 117 | + |
| 118 | +- Anthony Lo | [GitHub](https://github.com/anthonylo87) | |
| 119 | + [LinkedIn](https://linkedin.com/in/87anthonylo/) |
| 120 | +- Henry Park | [GitHub](https://github.com/CodeDenma) | |
| 121 | + [LinkedIn](https://linkedin.com/in/henrytpark/) |
| 122 | +- Carlos Villarreal | [GitHub](https://github.com/Jiggyloww) | |
| 123 | + [LinkedIn](https://linkedin.com/in/carlosvillarrealsb) |
| 124 | +- Eddie Wu | [GitHub](https://github.com/edi-wu) | |
| 125 | + [LinkedIn](https://linkedin.com/in/edi-wu) |
| 126 | + |
| 127 | +### Version 1.0 |
| 128 | + |
| 129 | +- Ben Engelberg | [GitHub](https://github.com/bengelberg) | |
| 130 | + [LinkedIn](https://linkedin.com/in/benengelberg) |
| 131 | +- Moonhee Hur | [GitHub](https://github.com/mhurcs) | |
| 132 | + [LinkedIn](https://linkedin.com/in/moonheehur) |
| 133 | +- Tesia Hwang | [GitHub](https://github.com/tesiahwang) | |
| 134 | + [LinkedIn](https://linkedin.com/in/tesia-hwang) |
| 135 | +- Kristen Lu | [GitHub](https://github.com/kristenlu24) | |
| 136 | + [LinkedIn](https://linkedin.com/in/kristen-lu) |
| 137 | +- Allison Roderiques | [GitHub](https://github.com/allirod) | |
| 138 | + [LinkedIn](https://linkedin.com/in/allison-roderiques) |
30 | 139 |
|
31 | 140 | ## License |
| 141 | + |
32 | 142 | MIT |
0 commit comments