Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Postgres.js #55

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Don't require until needed
porsager committed Jun 14, 2022
commit 07ec9dc875090377b4396c6da98d790395993be9
26 changes: 10 additions & 16 deletions jsbench.js
Original file line number Diff line number Diff line change
@@ -11,33 +11,27 @@
const argparse = require('argparse');
const _ = require('lodash');
const process = require('process');
const typeormapp = require('./_typeorm/build/index');
const sequelizeapp = require('./_sequelize/index');
const pgapp = require('./_postgres/index');
const postgresjs = require('./_postgresjs/index');
const edgedbapp = require('./_edgedb_js/index');
const prismaapp = require('./_prisma/index');

async function getApp(args) {
var app;
var ncon = args.concurrency;

if (args.orm == 'postgresjs') {
app = postgresjs({
app = require('./_postgresjs/index')({
host: args.host,
port: args.port,
max: ncon
})
await app.connect();
} else if (args.orm == 'typeorm') {
app = new typeormapp.App({
app = new (require('./_typeorm/build/index').App)({
host: args.host,
port: args.port,
extra: {max: ncon},
});
await app.connect();
} else if (args.orm == 'sequelize') {
app = new sequelizeapp.App({
app = new (require('./_sequelize/index').App)({
host: args.host,
port: args.port,
pool: {
@@ -46,41 +40,41 @@ async function getApp(args) {
},
});
} else if (args.orm == 'prisma_untuned') {
app = new prismaapp.App();
app = new (require('./_prisma/index').App)();
} else if (args.orm == 'prisma') {
app = new prismaapp.TunedApp();
app = new (require('./_prisma/index').TunedApp)();
} else if (args.orm == 'postgres_pg') {
app = new pgapp.App({
app = new (require('./_postgres/index').App)({
host: args.host,
port: args.port,
max: ncon,
});
} else if (args.orm == 'edgedb_js_json') {
app = new edgedbapp.App({
app = new (require('./_edgedb_js/index').App)({
style: 'json',
host: args.host,
port: args.port,
pool: ncon,
});
await app.initPool();
} else if (args.orm == 'edgedb_js') {
app = new edgedbapp.App({
app = new (require('./_edgedb_js/index').App)({
style: 'repack',
host: args.host,
port: args.port,
pool: ncon,
});
await app.initPool();
} else if (args.orm == 'edgedb_js_qb') {
app = new edgedbapp.App({
app = new (require('./_edgedb_js/index').App)({
style: 'querybuilder',
host: args.host,
port: args.port,
pool: ncon,
});
await app.initPool();
} else if (args.orm == 'edgedb_js_qb_uncached') {
app = new edgedbapp.App({
app = new (require('./_edgedb_js/index').App)({
style: 'querybuilder_uncached',
host: args.host,
port: args.port,