Skip to content

Commit

Permalink
Fixes to MikroORM schema, and making the whole thing pass tsc
Browse files Browse the repository at this point in the history
  • Loading branch information
boenrobot committed Jun 28, 2024
1 parent b822fa5 commit f58095c
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 140 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
npm-debug.log
package-lock.json
.vscode
coverage
coverage
dist
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"drizzle": "tsx ./src/drizzle/benchmark-pg.ts",
"orange": "tsx ./src/orange/benchmark-pg.ts",
"prisma": "tsx ./src/prisma/benchmark-pg.ts",
"mikroorm": "tsx ./src/mikro-orm/benchmark-pg.ts",
"mikroorm": "node ./dist/mikro-orm/benchmark-pg.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion src/drizzle/benchmark-pg.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { exit } from 'node:process';
import postgres from './postgres'
import postgres from './postgres.js'
import dotenv from 'dotenv';
dotenv.config();;
const ITERATIONS = Number.parseInt(process.env.ITERATIONS);
Expand Down
2 changes: 1 addition & 1 deletion src/drizzle/postgres.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from "postgres";
import * as schema from './schema';
import * as schema from './schema.js';


export const connection = postgres('postgres://postgres:postgres@postgres/postgres', { max: 1 });
Expand Down
2 changes: 1 addition & 1 deletion src/initPostgres.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import fs from 'node:fs';
const sql = fs.readFileSync(path.resolve("./data/init-postgres.sql"), "utf-8");
import db from './orange/postgres';
import db from './orange/postgres.js';
import { exit } from 'node:process';


Expand Down
12 changes: 6 additions & 6 deletions src/mikro-orm/benchmark-pg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import 'reflect-metadata';
import { MikroORM, ReflectMetadataProvider } from '@mikro-orm/core';
import { PostgreSqlDriver } from '@mikro-orm/postgresql';
import dotenv from 'dotenv';
import { Customer } from './schema';
import { Employee } from './schema';
import { Order } from './schema';
import { OrderDetail } from './schema';
import { Product } from './schema';
import { Supplier } from './schema';
import { Customer } from './schema.js';
import { Employee } from './schema.js';
import { Order } from './schema.js';
import { OrderDetail } from './schema.js';
import { Product } from './schema.js';
import { Supplier } from './schema.js';

dotenv.config();
const ITERATIONS = Number.parseInt(process.env.ITERATIONS);
Expand Down
Loading

0 comments on commit f58095c

Please sign in to comment.