Syntra SQL Type Reference
When you introspect Syntra’s schema from a SQL client, each column comes back with a type code and a type name. The Query Explorer’s Copy Schema JSON button surfaces them directly; other clients expose them via their own metadata APIs (pyodbc’s cursor.description, JDBC’s ResultSetMetaData, ADO.NET’s DbDataReader.GetSchemaTable, etc.).
This page is the authoritative chart of Syntra’s SQL types as they appear in schema output.
| Code | Type name | Storage | Range / precision | Example | Notes |
|---|---|---|---|---|---|
| 16 | bool | 1 byte | true, false, or NULL | true | Boolean. Some clients serialise as "true" / "false" strings. |
| 23 | int4 | 4 bytes | Signed 32-bit: −2,147,483,648 to 2,147,483,647 | 42 | Standard integer. Used for counts, flags, sublevel, etc. |
| 1043 | varchar | Variable | UTF-8, bounded by the column’s max_length (up to 4095 for long memos) | 'Bank of America' | The default type for names, IDs, descriptions, memos. |
| 1082 | date | 4 bytes | Calendar date, no time component | '2026-06-15' | Used for txn_date, due_date, job_start_date, etc. |
| 1114 | timestamp | 8 bytes | Microsecond-resolution timestamp without timezone | '2026-04-08 14:30:00' | Used for time_created and time_modified. QB stores timestamps in company-file local time. |
| 1700 | numeric | Variable | Arbitrary precision with declared scale — typically (12, 2) for money, (12, 5) for quantities | 123456.78 | Exact decimal. Always use numeric for money; never cast to a floating-point type for arithmetic. |
Reading Copy Schema JSON
Section titled “Reading Copy Schema JSON”Click Copy Schema JSON in the Query Explorer to get output shaped like this (accounts):
[ { "name": "list_id", "type": "varchar", "code": 1043 }, { "name": "time_created", "type": "timestamp", "code": 1114 }, { "name": "is_active", "type": "bool", "code": 16 }, { "name": "sublevel", "type": "int4", "code": 23 }, { "name": "balance", "type": "numeric", "code": 1700 }, { "name": "account_number", "type": "varchar", "code": 1043 }]The name is the column name you use in SQL. type and code describe the same data type — use whichever is more convenient for your code generator or ORM.
Reading metadata from client drivers
Section titled “Reading metadata from client drivers”pyodbc
Section titled “pyodbc”import pyodbc
conn = pyodbc.connect("DSN=Syntra QuickBooks")cur = conn.cursor()cur.execute("SELECT list_id, is_active, balance, time_created FROM accounts LIMIT 1")
for col in cur.description: print(col.name, "->", col.type_code, "precision", col.precision, "scale", col.scale)cursor.description returns (name, type_code, display_size, internal_size, precision, scale, nullable) per column. The type_code pyodbc returns is the Python target type it will materialise (str, int, bool, Decimal, datetime.date, datetime.datetime), not Syntra’s numeric code on this chart. Use the chart to cross-reference.
.NET (System.Data.Odbc)
Section titled “.NET (System.Data.Odbc)”using var conn = new OdbcConnection("DSN=Syntra QuickBooks");conn.Open();using var cmd = new OdbcCommand("SELECT list_id, is_active, balance FROM accounts LIMIT 1", conn);using var reader = cmd.ExecuteReader();
for (int i = 0; i < reader.FieldCount; i++){ Console.WriteLine($"{reader.GetName(i)} -> {reader.GetDataTypeName(i)} / {reader.GetFieldType(i)}");}GetDataTypeName(i) returns the SQL type name (varchar, bool, numeric, etc.). GetFieldType(i) returns the matching .NET CLR type (string, bool, decimal, DateTime, etc.).
Query Explorer
Section titled “Query Explorer”The bundled Query Explorer shows the type name next to each column heading in the result grid and in the column picker. The Copy Schema JSON button emits the JSON shape shown above.
Generic ODBC (C / C++)
Section titled “Generic ODBC (C / C++)”SQLColumns(...) returns column metadata directly from the driver. The numeric DATA_TYPE column in the result set is the ODBC SQL type (for example SQL_VARCHAR = 12, SQL_NUMERIC = 2, SQL_TYPE_DATE = 91), not Syntra’s native code. TYPE_NAME returns the string on the chart above.
Why these specific types
Section titled “Why these specific types”Syntra emits only the types needed to represent QuickBooks data:
- QuickBooks SDK integers are 32-bit. An 8-byte integer type isn’t used anywhere.
- Money and quantity fields are always
numericwith a declared scale. Syntra never uses a floating-point type for currency — the loss of precision would be catastrophic for accounting. - Date-only fields (
txn_date,due_date) usedate. Timestamp fields (time_created,time_modified) usetimestampwithout timezone — QuickBooks stores all timestamps in company-file local time and does not carry a UTC offset. - Text fields use
varcharwith an explicit bound from the QuickBooks schema. There is no unbounded text type.
This set of codes is stable across releases. If a future Syntra version adds a column that needs a new type (e.g., binary data), this page will be updated.
See also
Section titled “See also”- SELECT Queries
- Query Explorer
- Custom Fields — custom fields surface with the same types as native columns (almost always
varchar).