Skip to content

Commit

Permalink
renamed to db subfolders
Browse files Browse the repository at this point in the history
  • Loading branch information
ruyadorno committed Nov 23, 2023
1 parent 0332b43 commit b61095b
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 41 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,6 @@ jobs:
permissions:
contents: 'read'
id-token: 'write'
issues: write
pull-requests: write

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -412,5 +410,5 @@ jobs:
SQLSERVER_PASS: '${{ steps.secrets.outputs.SQLSERVER_PASS }}'
SQLSERVER_DB: '${{ steps.secrets.outputs.SQLSERVER_DB }}'
if: "${{ matrix.node-version != 'v14.x' }}"
run: npx tap -c -t0 --disable-coverage --allow-empty-coverage examples/*/{mysql2,pg,tedious}.test{.cjs,.mjs,.ts} -o test_results.tap
run: npx tap -c -t0 --disable-coverage --allow-empty-coverage examples/*/{mysql2,pg,tedious}/*.test{.cjs,.mjs,.ts} -o test_results.tap
timeout-minutes: 5
18 changes: 9 additions & 9 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ some of the most popular database libraries and frameworks.

### TypeORM

- [MySQL (CommonJS)](./typeorm/mysql2.cjs)
- [MySQL (ESM)](./typeorm/mysql2.mjs)
- [MySQL (TypeScript)](./typeorm/mysql2.ts)
- [PostgreSQL (CommonJS)](./typeorm/pg.cjs)
- [PostgreSQL (ESM)](./typeorm/pg.mjs)
- [PostgreSQL (TypeScript)](./typeorm/pg.ts)
- [SQL Server (CommonJS)](./typeorm/tedious.cjs)
- [SQL Server (ESM)](./typeorm/tedious.mjs)
- [SQL Server (TypeScript)](./typeorm/tedious.ts)
- [MySQL (CommonJS)](./typeorm/mysql2/connect.cjs)
- [MySQL (ESM)](./typeorm/mysql2/connect.mjs)
- [MySQL (TypeScript)](./typeorm/mysql2/connect.ts)
- [PostgreSQL (CommonJS)](./typeorm/pg/connect.cjs)
- [PostgreSQL (ESM)](./typeorm/pg/connect.mjs)
- [PostgreSQL (TypeScript)](./typeorm/pg/connect.ts)
- [SQL Server (CommonJS)](./typeorm/tedious/connect.cjs)
- [SQL Server (ESM)](./typeorm/tedious/connect.mjs)
- [SQL Server (TypeScript)](./typeorm/tedious/connect.ts)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
// limitations under the License.

const t = require('tap');
const connector = require('./mysql2.cjs');
const connector = require('./connect.cjs');

t.test('mysql2 typeorm cjs', async t => {
const { dataSource, close } = await connector.connect({
instanceConnectionName: process.env.MYSQL_IAM_CONNECTION_NAME,
username: process.env.MYSQL_IAM_USER,
database: process.env.MYSQL_DB,
});
const [{ now: time }] = await dataSource.manager.query('SELECT NOW() as now')
t.ok(time.getTime(), 'should have valid returned date object');
const [{ now }] = await dataSource.manager.query('SELECT NOW() as now')
t.ok(now.getTime(), 'should have valid returned date object');
await close();
});

Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
// limitations under the License.

import t from 'tap';
import {connect} from './mysql2.mjs';
import {connect} from './connect.mjs';

t.test('mysql2 typeorm mjs', async t => {
const { dataSource, close } = await connect({
instanceConnectionName: process.env.MYSQL_IAM_CONNECTION_NAME,
username: process.env.MYSQL_IAM_USER,
database: process.env.MYSQL_DB,
});
const [{ now: time }] = await dataSource.manager.query('SELECT NOW() as now');
t.ok(time.getTime(), 'should have valid returned date object');
const [{ now }] = await dataSource.manager.query('SELECT NOW() as now');
t.ok(now.getTime(), 'should have valid returned date object');
await close();
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
// limitations under the License.

import t from 'tap';
import {connect} from './mysql2';
import {connect} from './connect';

t.test('mysql typeorm ts', async t => {
const {dataSource, close} = await connect({
instanceConnectionName: process.env.MYSQL_IAM_CONNECTION_NAME,
username: process.env.MYSQL_IAM_USER,
database: process.env.MYSQL_DB,
});
const [{now: time}] = await dataSource.manager.query('SELECT NOW() as now');
t.ok(time.getTime(), 'should have valid returned date object');
const [{now}] = await dataSource.manager.query('SELECT NOW() as now');
t.ok(now.getTime(), 'should have valid returned date object');
await close();
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
// limitations under the License.

const t = require('tap');
const connector = require('./pg.cjs');
const connector = require('./connect.cjs');

t.test('pg typeorm cjs', async t => {
const { dataSource, close } = await connector.connect({
instanceConnectionName: process.env.POSTGRES_IAM_CONNECTION_NAME,
username: process.env.POSTGRES_IAM_USER,
database: process.env.POSTGRES_DB,
});
const [{ now: time }] = await dataSource.manager.query('SELECT NOW() as now')
t.ok(time.getTime(), 'should have valid returned date object');
const [{ now }] = await dataSource.manager.query('SELECT NOW() as now')
t.ok(now.getTime(), 'should have valid returned date object');
await close();
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
// limitations under the License.

import t from 'tap';
import {connect} from './pg.mjs';
import {connect} from './connect.mjs';

t.test('pg typeorm mjs', async t => {
const { dataSource, close } = await connect({
instanceConnectionName: process.env.POSTGRES_IAM_CONNECTION_NAME,
username: process.env.POSTGRES_IAM_USER,
database: process.env.POSTGRES_DB,
});
const [{ now: time }] = await dataSource.manager.query('SELECT NOW() as now');
t.ok(time.getTime(), 'should have valid returned date object');
const [{ now }] = await dataSource.manager.query('SELECT NOW() as now');
t.ok(now.getTime(), 'should have valid returned date object');
await close();
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
// limitations under the License.

import t from 'tap';
import {connect} from './pg';
import {connect} from './connect';

t.test('pg typeorm ts', async t => {
const {dataSource, close} = await connect({
instanceConnectionName: process.env.POSTGRES_IAM_CONNECTION_NAME,
username: process.env.POSTGRES_IAM_USER,
database: process.env.POSTGRES_DB,
});
const [{now: time}] = await dataSource.manager.query('SELECT NOW() as now');
t.ok(time.getTime(), 'should have valid returned date object');
const [{now}] = await dataSource.manager.query('SELECT NOW() as now');
t.ok(now.getTime(), 'should have valid returned date object');
await close();
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

const t = require('tap');
const connector = require('./tedious.cjs');
const connector = require('./connect.cjs');

t.test('tedious typeorm cjs', async t => {
const { dataSource, close } = await connector.connect({
Expand All @@ -22,7 +22,7 @@ t.test('tedious typeorm cjs', async t => {
password: process.env.SQLSERVER_PASS,
database: process.env.SQLSERVER_DB,
});
const [{ now: time }] = await dataSource.manager.query('SELECT GETUTCDATE() as now')
t.ok(time.getTime(), 'should have valid returned date object');
const [{ now }] = await dataSource.manager.query('SELECT GETUTCDATE() as now')
t.ok(now.getTime(), 'should have valid returned date object');
await close();
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

import t from 'tap';
import {connect} from './tedious.mjs';
import {connect} from './connect.mjs';

t.test('tedious typeorm mjs', async t => {
const { dataSource, close } = await connect({
Expand All @@ -22,7 +22,7 @@ t.test('tedious typeorm mjs', async t => {
password: process.env.SQLSERVER_PASS,
database: process.env.SQLSERVER_DB,
});
const [{ now: time }] = await dataSource.manager.query('SELECT GETUTCDATE() as now')
t.ok(time.getTime(), 'should have valid returned date object');
const [{ now }] = await dataSource.manager.query('SELECT GETUTCDATE() as now')
t.ok(now.getTime(), 'should have valid returned date object');
await close();
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

import t from 'tap';
import {connect} from './tedious';
import {connect} from './connect';

t.test('tedious typeorm ts', async t => {
const {dataSource, close} = await connect({
Expand All @@ -22,9 +22,7 @@ t.test('tedious typeorm ts', async t => {
password: process.env.SQLSERVER_PASS,
database: process.env.SQLSERVER_DB,
});
const [{now: time}] = await dataSource.manager.query(
'SELECT GETUTCDATE() as now'
);
t.ok(time.getTime(), 'should have valid returned date object');
const [{now}] = await dataSource.manager.query('SELECT GETUTCDATE() as now');
t.ok(now.getTime(), 'should have valid returned date object');
await close();
});
File renamed without changes.

0 comments on commit b61095b

Please sign in to comment.