loadSchema
Loads SQL schema definitions from the specified directory, processes each .sql
file encountered, and constructs a representation of the database schema consisting of tables and their columns.
Each file in the directory is expected to follow a specific naming convention: <version>_<name>.sql
(e.g., 001_create_users.sql
). Files are processed in order of their version prefixes, starting from the lowest.
Parameters
path
The file system path to the directory containing .sql
schema files. It must be an existing directory, and all .sql
files inside should adhere to the required naming convention and contain valid SQL statements.