Skip to content

Commit

Permalink
more nits to OPTIMIZE TABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
drodrigues4 committed Jul 25, 2024
1 parent a72e61c commit 52963af
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drizzle-orm/src/singlestore-core/dialect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ export class SingleStoreDialect {
buildOptimizeTable({ table, arg, selection }: SingleStoreOptimizeTableConfig): SQL {
const argSql = arg ? sql` ${sql.raw(arg)}` : undefined;

const warmBlobCacheForColumnSql = selection ?
sql` warm blob cache for column ${selection}`
: undefined;
let warmBlobCacheForColumnSql = undefined;
if (selection) {
const selectionField = selection.map((column) => { return { path: [], field: column } });
warmBlobCacheForColumnSql = sql` warm blob cache for column ${this.buildSelection(selectionField, { isSingleTable: true })}`;
}

return sql`optimize table ${table}${argSql}${warmBlobCacheForColumnSql}`;
}
Expand Down

0 comments on commit 52963af

Please sign in to comment.