| sidebar_position | 2 |
|---|---|
| title | CLI Reference |
| description | Complete sqlgg command-line reference |
import CliOptions from './_cli-options.md';
sqlgg <options> <file.sql> [<file2.sql> ...]
Files are read as one stream: DDL builds up the schema, queries become generated functions. Each option applies to the files after it, which is how the schema goes in without generating code:
sqlgg -gen none ddl.sql -gen caml dml.sqlWithout -params the mode follows -dialect: MySQL, TiDB and SQLite use unnamed (?), PostgreSQL uses postgresql ($1, $2, ...). oracle produces :param, named keeps @param as is, none fails on queries with autogenerated parameters.
Drops the version and timestamp from the header, so the generated file only changes when the SQL does. Use it with dune promote rules (see Getting Started).