Skip to content

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.

CodeType nameStorageRange / precisionExampleNotes
16bool1 bytetrue, false, or NULLtrueBoolean. Some clients serialise as "true" / "false" strings.
23int44 bytesSigned 32-bit: −2,147,483,648 to 2,147,483,64742Standard integer. Used for counts, flags, sublevel, etc.
1043varcharVariableUTF-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.
1082date4 bytesCalendar date, no time component'2026-06-15'Used for txn_date, due_date, job_start_date, etc.
1114timestamp8 bytesMicrosecond-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.
1700numericVariableArbitrary precision with declared scale — typically (12, 2) for money, (12, 5) for quantities123456.78Exact decimal. Always use numeric for money; never cast to a floating-point type for arithmetic.

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.

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.

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

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.

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.

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 numeric with 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) use date. Timestamp fields (time_created, time_modified) use timestamp without timezone — QuickBooks stores all timestamps in company-file local time and does not carry a UTC offset.
  • Text fields use varchar with 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.