-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
17 lines (14 loc) · 962 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const Knex = require('knex');
async function start() {
const knex = Knex({
client: "pg",
connection: `postgres://ob:dev@localhost:5432/bugtests`,
});
const result = await knex('subscriptions').innerJoin('paymentProviderCustomerReferences as paymentProviderCustomerReference', 'subscriptions.paymentProviderCustomerReferenceId', 'paymentProviderCustomerReference.id').innerJoin('organizations as paymentProviderCustomerReference_organization', 'paymentProviderCustomerReference.organizationId', 'paymentProviderCustomerReference_organization.id').select('paymentProviderCustomerReference_organization.accessUntilExtended as paymentProviderCustomerReference.organization.accessUntilExtended').where({ 'subscriptions.id': 'f48a6316-5eff-451e-b64a-a89b71fe059d' });
console.log('result: ', result);
// Results in :
// {
// 'paymentProviderCustomerReference.organization.accessUntilExtend': false
// }
}
start();