Skip to content

Commit 8e8b06a

Browse files
committed
docs: update DEVELOPMENT.md with SQL development guidelines
Add "Adding SQL" section to DEVELOPMENT.md with guidelines for: - Modular SQL file organization - Operator wrappers vs implementation separation - Dependency declarations using REQUIRE comments - Test file naming conventions - Build system usage with tsort Provides clear guidance for contributors developing new SQL features.
1 parent f995a7c commit 8e8b06a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

DEVELOPMENT.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,17 @@ This produces two SQL files in `releases/`:
318318

319319
## Structure
320320

321+
### Adding SQL
322+
323+
When adding new SQL files to the project, follow these guidelines:
324+
325+
- Never drop the configuration table as it may contain customer data and needs to live across EQL versions
326+
- Everything else should have a `DROP IF EXISTS`
327+
- Functions should be `DROP` and `CREATE`, instead of `CREATE OR REPLACE`
328+
- Data types cannot be changed once created, so dropping first is more flexible
329+
- Keep `DROP` and `CREATE` together in the code
330+
- Types need to be dropped last, add to the `666-drop_types.sql`
331+
321332
### Schema
322333

323334
EQL is installed into the `eql_v2` PostgreSQL schema.

0 commit comments

Comments
 (0)