feat: sql-tools overrides (#19796)

This commit is contained in:
Jason Rasmussen 2025-07-08 08:17:40 -04:00 committed by GitHub
parent 1f9813a28e
commit df4a27e8a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
114 changed files with 775 additions and 289 deletions

View file

@ -1,11 +1,14 @@
import { BaseContext } from 'src/sql-tools/contexts/base-context';
import { transformIndexes } from 'src/sql-tools/transformers/index.transformer';
import { describe, expect, it } from 'vitest';
const ctx = new BaseContext({});
describe(transformIndexes.name, () => {
describe('IndexCreate', () => {
it('should work', () => {
expect(
transformIndexes({
transformIndexes(ctx, {
type: 'IndexCreate',
index: {
name: 'IDX_test',
@ -21,7 +24,7 @@ describe(transformIndexes.name, () => {
it('should create an unique index', () => {
expect(
transformIndexes({
transformIndexes(ctx, {
type: 'IndexCreate',
index: {
name: 'IDX_test',
@ -37,7 +40,7 @@ describe(transformIndexes.name, () => {
it('should create an index with a custom expression', () => {
expect(
transformIndexes({
transformIndexes(ctx, {
type: 'IndexCreate',
index: {
name: 'IDX_test',
@ -53,7 +56,7 @@ describe(transformIndexes.name, () => {
it('should create an index with a where clause', () => {
expect(
transformIndexes({
transformIndexes(ctx, {
type: 'IndexCreate',
index: {
name: 'IDX_test',
@ -70,7 +73,7 @@ describe(transformIndexes.name, () => {
it('should create an index with a custom expression', () => {
expect(
transformIndexes({
transformIndexes(ctx, {
type: 'IndexCreate',
index: {
name: 'IDX_test',
@ -89,7 +92,7 @@ describe(transformIndexes.name, () => {
describe('IndexDrop', () => {
it('should work', () => {
expect(
transformIndexes({
transformIndexes(ctx, {
type: 'IndexDrop',
indexName: 'IDX_test',
reason: 'unknown',