Skip to content

Latest commit

 

History

History
49 lines (41 loc) · 1.43 KB

sql.md

File metadata and controls

49 lines (41 loc) · 1.43 KB

SQL

This utility expects all your database scripts and objects (schemas, views, procedures, functions, etc) be defined as SQL source files.

Additionally, your sql source files are expected to follow the opinionated directory structure as shown below under the sql base directory.

By default the sql base directory i.e basePath is src unless changed via configuration.

Directory Structure

The SQL source directory structure - this is the sql/ directory under the basePath.

 └─ sql
    ├─ schema
    │  ├─ schema1.sql
    │  ├─ schema2.sql
    │  ├─ schema3.sql
    │  └─ ...
    │
    ├─ function
    │  ├─ schema1
    │  │  ├─ function1.sql
    │  │  ├─ function2.sql
    │  │  └─ ...
    │  ├─ schema2
    │  │  ├─ function3.sql
    │  │  ├─ function4.sql
    │  │  └─ ...
    │  ├─ function5.sql
    │  └─ ...
    │
    ├─ procedure
    │  ├─ schema1
    │  │  ├─ procedure1.sql
    │  │  ├─ procedure2.sql
    │  │  └─ ...
    │  ├─ schema2
    │  │  ├─ procedure3.sql
    │  │  ├─ procedure4.sql
    │  │  └─ ...
    │  ├─ procedure5.sql
    │  └─ ...
    │
    └─...

Note: When the SQL files aren't placed under the schema directories, they are associated with the default schema.