Skip to content

Commit 40b63af

Browse files
committed
Merge branch 'dev' into mh/cleanup
2 parents 1496b21 + 2b729a1 commit 40b63af

File tree

8 files changed

+11
-160
lines changed

8 files changed

+11
-160
lines changed

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Welcome to DenoGres! A new comprehensive ORM for PostgreSQL and Deno.
33

44
## Getting Started
55
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://raw.githubusercontent.com/oslabs-beta/DenoGres/dev/mod.ts`
6+
>`deno install --allow-read --allow-write --allow-net --allow-env --name denogres https://deno.land/x/denogres/mod.ts`
77
88
After installation is complete, ensure deno is added to PATH.
99

@@ -26,4 +26,7 @@ DenoGres includes some functionality that is still in development - including da
2626
>`denogres --db-sync`
2727
2828
## Documents
29-
More information on how to use DenoGres and leverage all its wonderful abstraction functionality can be found here: https://denogres.deno.dev/
29+
More information on how to use DenoGres and leverage all its wonderful abstraction functionality can be found here: https://denogres.deno.dev/
30+
31+
## License
32+
MIT

Test/dbPull.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { assert } from './deps.ts';
22
import { dbPull } from '../src/functions/dbPull.ts';
33

44
const generatedModel =
5-
`import { Model } from 'https://raw.githubusercontent.com/oslabs-beta/DenoGres/dev/mod.ts'
5+
`import { Model } from 'https://deno.land/x/denogres/mod.ts'
66
// user model definition comes here
77
88

mod.ts

-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ switch(Deno.args[0]) {
1212
break;
1313

1414
case '--db-pull': {// introspection begins
15-
// Check for database URI
16-
// Deno.env.set(URI, value)
17-
// Deno.env.get(URI)
1815
const envVar = parse(await Deno.readTextFile('./.env')); // Get DB_URI
1916

2017
if(envVar.DATABASE_URI === "") {
@@ -35,7 +32,6 @@ switch(Deno.args[0]) {
3532

3633
function displayHelpMsg() {
3734
return `flags:
38-
-h, --help: display help message
3935
--init: set-up DenoGres required files
4036
--db-pull: Introspect database and create and populate model.ts file`;
4137
}

models/model.ts

-148
This file was deleted.

src/functions/dbPull.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { introspect } from './introspect.ts'
66
export async function dbPull() {
77
const [tableListObj, enumObj] = await introspect();
88

9-
let autoCreatedModels = `import { Model } from 'https://raw.githubusercontent.com/oslabs-beta/DenoGres/dev/mod.ts'\n// user model definition comes here\n\n`;
9+
let autoCreatedModels = `import { Model } from 'https://deno.land/x/denogres/mod.ts'\n// user model definition comes here\n\n`;
1010

1111
// iterate over the properties of tableListObj
1212
Object.keys(tableListObj).forEach(el => {

src/functions/enumParser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export const enumParser = (): Record<string, unknown[]> => {
22
const modelText = Deno.readTextFileSync('./models/model.ts');
33

44
const enumText = modelText.replaceAll(/export interface \w+ {[\n +\w+: \w+]+}/g, '').
5-
replaceAll("import { Model } from 'https://raw.githubusercontent.com/oslabs-beta/DenoGres/dev/mod.ts'\n", ''). // initial wording
5+
replaceAll("import { Model } from 'https://deno.land/x/denogres/mod.ts'\n", ''). // initial wording
66
replaceAll(/\/\/ user model definition comes here\n+/g, '').
77
replaceAll(/\n */g, '').
88
matchAll(/export enum \w+ {[\n *\w+\,*]+}/g) // remove enums for now, will need different logic to parse these

src/functions/init.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ensureDir } from "../..//deps.ts";
1+
import { ensureDir } from "../../deps.ts";
22

33
export function init() {
44
// create .env file in root directory
@@ -22,7 +22,7 @@ TEST_DB_URI=" "
2222
// inside the model folder, create model.ts file with boilerplate code
2323
const modelFilePath = "./models/";
2424
const modelFileContent = `
25-
import { Model } from 'https://raw.githubusercontent.com/oslabs-beta/DenoGres/dev/mod.ts'
25+
import { Model } from 'https://deno.land/x/denogres/mod.ts'
2626
// user model definition comes here
2727
`
2828
ensureDir(modelFilePath).then(() => {

src/functions/modelParser.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface ModelInfo {
2525
export const modelParser = (): ModelInfo[] => {
2626
const modelText = Deno.readTextFileSync('./models/model.ts');
2727
const cleanedText = modelText.replaceAll(/export interface \w+ *\{[\n* *.*: \w+,*]+\}/g, '').
28-
replaceAll("import { Model } from 'https://raw.githubusercontent.com/oslabs-beta/DenoGres/dev/mod.ts'\n", ''). // initial wording
28+
replaceAll("import { Model } from 'https://deno.land/x/denogres/mod.ts'\n", ''). // initial wording
2929
replaceAll(/\/\/ user model definition comes here\n+/g, '').
3030
replaceAll(/\n */g, '').
3131
replaceAll(/export enum \w+ {[\n *\w+\,*]+}/g, '') // remove enums for now, will need different logic to parse these

0 commit comments

Comments
 (0)