Skip to content

Commit

Permalink
move limit function in sqlGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
SpencerTorres committed Nov 29, 2023
1 parent 8f1d50c commit de26f5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/data/sqlGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const generateSql = (options: QueryBuilderOptions): string => {
*/
const generateTraceQuery = (options: QueryBuilderOptions): string => {
const { database, table } = options;
const limit = getLimit(options.limit);

const queryParts: string[] = [];

Expand Down Expand Up @@ -98,6 +97,7 @@ const generateTraceQuery = (options: QueryBuilderOptions): string => {
queryParts.push('ORDER BY startTime ASC');
}

const limit = getLimit(options.limit);
if (limit !== '') {
queryParts.push(limit);
}
Expand All @@ -114,7 +114,6 @@ const generateTraceQuery = (options: QueryBuilderOptions): string => {
*/
const generateLogsQuery = (options: QueryBuilderOptions): string => {
const { database, table } = options;
const limit = getLimit(options.limit);

const queryParts: string[] = [];

Expand Down Expand Up @@ -162,6 +161,7 @@ const generateLogsQuery = (options: QueryBuilderOptions): string => {
queryParts.push(getOrderBy(options.orderBy, false));
}

const limit = getLimit(options.limit);
if (limit !== '') {
queryParts.push(limit);
}
Expand Down

0 comments on commit de26f5f

Please sign in to comment.