Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 968 Bytes

cli.md

File metadata and controls

31 lines (20 loc) · 968 Bytes
sidebar_position 2
title CLI Reference
description Complete sqlgg command-line reference

import CliOptions from './_cli-options.md';

CLI Reference

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.sql

All Options

-params

Without -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.

-static-header

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).