Skip to content

Commit 333beef

Browse files
author
Sylvestre Gug
committed
prettier table.mjs
1 parent a14b272 commit 333beef

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

src/table.mjs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,25 +259,32 @@ export function makeQueryTemplate(operations, source) {
259259
sort[i].column = escaper(sort[i].column);
260260
appendOrderBy(sort[i], args);
261261
}
262-
if(source.dialect === 'mssql'){
262+
if (source.dialect === "mssql") {
263263
if (slice.to !== null || slice.from !== null) {
264-
if(!sort.length){
264+
if (!sort.length) {
265265
if (columns[0] === "*")
266-
throw new Error("at least one column must be explicitly specified. Received '*'.");
266+
throw new Error(
267+
"at least one column must be explicitly specified. Received '*'."
268+
);
267269
appendSql(`\nORDER BY `, args);
268-
appendOrderBy({column: escaper(select.columns[0]), direction: 'ASC'}, args);
270+
appendOrderBy(
271+
{column: escaper(select.columns[0]), direction: "ASC"},
272+
args
273+
);
269274
}
270275
appendSql(`\nOFFSET ${slice.from || 0} ROWS`, args);
271276
appendSql(
272-
`\nFETCH NEXT ${slice.to !== null ? slice.to - (slice.from || 0) : 1e9} ROWS ONLY`,
273-
args
277+
`\nFETCH NEXT ${
278+
slice.to !== null ? slice.to - (slice.from || 0) : 1e9
279+
} ROWS ONLY`,
280+
args
274281
);
275282
}
276-
}else{
283+
} else {
277284
if (slice.to !== null || slice.from !== null) {
278285
appendSql(
279-
`\nLIMIT ${slice.to !== null ? slice.to - (slice.from || 0) : 1e9}`,
280-
args
286+
`\nLIMIT ${slice.to !== null ? slice.to - (slice.from || 0) : 1e9}`,
287+
args
281288
);
282289
}
283290
if (slice.from !== null) {

0 commit comments

Comments
 (0)