modified: backend/src/controllers/databaseManagementController.ts
modified: backend/src/controllers/dynamicApiController.ts modified: backend/src/controllers/endpointController.ts new file: backend/src/migrations/005_add_aql_support.sql new file: backend/src/services/AqlExecutor.ts modified: backend/src/types/index.ts modified: frontend/src/components/EndpointModal.tsx modified: frontend/src/pages/Databases.tsx modified: frontend/src/types/index.ts
This commit is contained in:
40
backend/src/migrations/005_add_aql_support.sql
Normal file
40
backend/src/migrations/005_add_aql_support.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
-- Add AQL support to databases table
|
||||
ALTER TABLE databases
|
||||
ALTER COLUMN type TYPE VARCHAR(50);
|
||||
|
||||
-- Update the type check constraint to include 'aql'
|
||||
ALTER TABLE databases
|
||||
DROP CONSTRAINT IF EXISTS databases_type_check;
|
||||
|
||||
ALTER TABLE databases
|
||||
ADD CONSTRAINT databases_type_check
|
||||
CHECK (type IN ('postgresql', 'mysql', 'mssql', 'aql'));
|
||||
|
||||
-- Add AQL-specific columns to databases table
|
||||
ALTER TABLE databases
|
||||
ADD COLUMN IF NOT EXISTS aql_base_url TEXT,
|
||||
ADD COLUMN IF NOT EXISTS aql_auth_type VARCHAR(50) CHECK (aql_auth_type IN ('basic', 'bearer', 'custom')),
|
||||
ADD COLUMN IF NOT EXISTS aql_auth_value TEXT,
|
||||
ADD COLUMN IF NOT EXISTS aql_headers JSONB DEFAULT '{}'::jsonb;
|
||||
|
||||
-- Add AQL support to endpoints table
|
||||
ALTER TABLE endpoints
|
||||
ALTER COLUMN execution_type TYPE VARCHAR(50);
|
||||
|
||||
-- Update execution_type check constraint to include 'aql'
|
||||
ALTER TABLE endpoints
|
||||
DROP CONSTRAINT IF EXISTS endpoints_execution_type_check;
|
||||
|
||||
ALTER TABLE endpoints
|
||||
ADD CONSTRAINT endpoints_execution_type_check
|
||||
CHECK (execution_type IN ('sql', 'script', 'aql'));
|
||||
|
||||
-- Add AQL-specific columns to endpoints table
|
||||
ALTER TABLE endpoints
|
||||
ADD COLUMN IF NOT EXISTS aql_method VARCHAR(10) CHECK (aql_method IN ('GET', 'POST', 'PUT', 'DELETE')),
|
||||
ADD COLUMN IF NOT EXISTS aql_endpoint TEXT,
|
||||
ADD COLUMN IF NOT EXISTS aql_body TEXT,
|
||||
ADD COLUMN IF NOT EXISTS aql_query_params JSONB DEFAULT '{}'::jsonb;
|
||||
|
||||
-- Create index for AQL endpoints
|
||||
CREATE INDEX IF NOT EXISTS idx_endpoints_execution_type ON endpoints(execution_type);
|
||||
Reference in New Issue
Block a user