Skip to content

Commit 7c7b772

Browse files
committed
[hygiene] Prettier & lint
1 parent ac53b49 commit 7c7b772

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/persisters/common/database/common.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ export const getPlaceholders = (array: any[], offset = [1]) =>
5454
COMMA,
5555
);
5656

57-
export const getWhereCondition = (tableName: string, condition?: string | null) =>
57+
export const getWhereCondition = (
58+
tableName: string,
59+
condition?: string | null,
60+
) =>
5861
condition
5962
? ' ' + condition.replace(TABLE_NAME_PLACEHOLDER, escapeId(tableName))
6063
: ' true';

test/unit/persisters/database/tabular.test.ts

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe.each(Object.entries(ALL_VARIANTS))(
121121
t6: {
122122
tableName: 't6',
123123
condition: isPostgres
124-
? "$tableName.c6 = '1'"
124+
? `$tableName.c6 = '1'`
125125
: '$tableName.c6 = 1',
126126
},
127127
},
@@ -362,7 +362,7 @@ describe.each(Object.entries(ALL_VARIANTS))(
362362
t6: {
363363
tableId: 't6',
364364
condition: isPostgres
365-
? "$tableName.c6 = '1'"
365+
? `$tableName.c6 = '1'`
366366
: '$tableName.c6 = 1',
367367
},
368368
tinybase_values: {tableId: 'values'},
@@ -608,7 +608,7 @@ describe.each(Object.entries(ALL_VARIANTS))(
608608
t1: {
609609
tableName: 't1',
610610
condition: isPostgres
611-
? "$tableName.c0 = '1'"
611+
? `$tableName.c0 = '1'`
612612
: '$tableName.c0 = 1',
613613
},
614614
},
@@ -877,21 +877,15 @@ describe.each(Object.entries(ALL_VARIANTS))(
877877
describe('Load from database', () => {
878878
let persister: Persister;
879879
beforeEach(async () => {
880-
persister = await getPersister(
881-
store,
882-
db,
883-
{
884-
mode: 'tabular',
885-
tables: {
886-
load: {t1: 't1', t2: 't2', t3: 't3'},
887-
save: {t1: 't1', t2: 't2', t3: 't3'},
888-
},
889-
values: {load: true, save: true},
890-
autoLoadIntervalSeconds,
880+
persister = await getPersister(store, db, {
881+
mode: 'tabular',
882+
tables: {
883+
load: {t1: 't1', t2: 't2', t3: 't3'},
884+
save: {t1: 't1', t2: 't2', t3: 't3'},
891885
},
892-
undefined,
893-
(err) => console.error(err),
894-
);
886+
values: {load: true, save: true},
887+
autoLoadIntervalSeconds,
888+
});
895889
});
896890

897891
test('nothing', async () => {
@@ -1281,7 +1275,10 @@ describe.each(Object.entries(ALL_VARIANTS))(
12811275
'INSERT INTO"tinybase_values"("_id","v1","v2")VALUES($1,$2,$3)ON CONFLICT("_id")DO UPDATE SET"v1"=excluded."v1","v2"=excluded."v2"',
12821276
['_', encodedValue(1), encodedValue(2)],
12831277
],
1284-
['DELETE FROM"tinybase_values"WHERE"_id"NOT IN($1) AND ( true)', ['_']],
1278+
[
1279+
'DELETE FROM"tinybase_values"WHERE"_id"NOT IN($1) AND ( true)',
1280+
['_'],
1281+
],
12851282
['END', undefined],
12861283
]);
12871284
});

0 commit comments

Comments
 (0)