Generator configuration
sqlDdlHint
Commentary
added in 1.15.3
local configuration
Supplies an explicit SQL DDL statement to create tables on behalf of a generator, rather than letting ShadowTraffic guess on its own.
Notably, using sqlDdlHint supercedes all sqlHint function modifiers, since hints on individual columns are no longer needed.
This configuration works on all SQL connections, including Postgres, MotherDuck, MySQL, SQL Server, and Oracle.
Examples
Supplying a DDL
Supply the statement as a localConfig. Accepts arbitrary SQL, and you can supply as many statements as you like, which is especially helpful if your generator writes to multiple tables.
{
"generators": [
{
"table": "customers",
"vars": {
"x": {
"_gen": "profile",
"traits": [
"firstName",
"lastName",
"email",
"company",
"website"
]
}
},
"row": {
"_gen": "var",
"var": "x"
},
"localConfigs": {
"sqlDdlHint": "CREATE TABLE customers(firstName TEXT, lastName TEXT, company TEXT, website TEXT);"
}
}
],
"connections": {
"postgres": {
"kind": "postgres",
"connectionConfigs": {
"host": "localhost",
"port": 5432,
"username": "postgres",
"password": "postgres",
"db": "mydb"
}
}
}
}
[
{
"email": "stefanny.ponce@spikescavell.com",
"website": "www.spikescavell.com",
"company": "Spikes Cavell Analytic Inc",
"lastName": "Ponce",
"firstName": "Stefanny"
},
{
"email": "kevin@otcmarkets.com",
"website": "www.otcmarkets.com",
"company": "OTC Markets",
"lastName": "Morelli",
"firstName": "Kevin"
},
{
"email": "carolyn@lumesis.com",
"website": "www.lumesis.com",
"company": "Lumesis, Inc.",
"lastName": "Collins",
"firstName": "Carolyn"
},
{
"email": "d.dalsania@publicengines.com",
"website": "www.publicengines.com",
"company": "PublicEngines",
"lastName": "Dalsania",
"firstName": "Deokie"
},
{
"email": "dsmith@zurichna.com",
"website": "www.zurichna.com",
"company": "Zurich Insurance (Risk Room)",
"lastName": "Smith",
"firstName": "Dominick"
}
]
Specification
JSON schema
{
"type": "string"
}