QuickBooks, with IntelliSense.
A TypeScript SDK for Syntra ODBC. Typed Drizzle schema, a zero-config client, and a codegen CLI. Full autocomplete on every QuickBooks table and column.
import { drizzle } from 'drizzle-orm/postgres-js';
import postgres from 'postgres';
import * as schema from '@syntraodbc/drizzle-schema';
const db = drizzle(postgres(process.env.SYNTRA_URL!), { schema });
// Fully typed. Autocomplete on every QuickBooks table.
const rows = await db.select().from(schema.invoices);
Install in one line
No post-install step, no code generation required to get started. The schema for every stock QuickBooks table ships inside the package.
$ npm install @syntraodbc/drizzle-schema drizzle-orm postgres $ pnpm add @syntraodbc/drizzle-schema drizzle-orm postgres $ yarn add @syntraodbc/drizzle-schema drizzle-orm postgres $ bun add @syntraodbc/drizzle-schema drizzle-orm postgres
Also available: @syntraodbc/client (zero-config typed client) and @syntraodbc/codegen (regenerate types for custom fields).
Typed queries with Drizzle ORM
Drop in @syntraodbc/drizzle-schema and get compile-time autocomplete on every table, column, and return type. The snippet below is 100% typed, end to end.
import { drizzle } from 'drizzle-orm/postgres-js';
import { eq, and, lt } from 'drizzle-orm';
import postgres from 'postgres';
import * as schema from '@syntraodbc/drizzle-schema';
const db = drizzle(
postgres('postgres://qbconnect@localhost:5433/quickbooks', {
password: process.env.SYNTRA_PASSWORD,
}),
{ schema }
);
// Full IntelliSense on tables and columns. Zero hand-written types.
const overdue = await db
.select({
customer: schema.customers.full_name,
ref: schema.invoices.ref_number,
balance: schema.invoices.balance_remaining,
dueDate: schema.invoices.due_date,
})
.from(schema.invoices)
.innerJoin(schema.customers, eq(schema.invoices.customer_ref, schema.customers.list_id))
.where(and(
lt(schema.invoices.due_date, new Date()),
eq(schema.invoices.is_paid, false),
));
New to Drizzle with QuickBooks? See the Drizzle integration guide for a full walkthrough, or the Node.js guide for the raw pg approach.
Or skip the ORM
@syntraodbc/client is a thin strongly-typed wrapper over postgres.js. Connect, select, done. Same autocomplete, none of the ORM weight.
- →Type-safe table and column names
- →Inferred return-row types
- →Defaults matched to the Syntra connection (
localhost:5433,quickbooks,qbconnect)
import { createClient } from '@syntraodbc/client';
const syntra = createClient({ password: process.env.SYNTRA_PASSWORD });
// Table names and columns autocomplete straight from your QuickBooks schema.
const rows = await syntra
.table('invoices')
.select('ref_number', 'balance_remaining', 'due_date')
.where({ is_paid: false }); # Regenerate types against your own QuickBooks file,
# picking up custom fields and user-defined columns.
npx @syntraodbc/codegen \
--host localhost \
--port 5433 \
--user qbconnect \
--database quickbooks \
--out ./src/generated Custom fields? Regenerate.
QuickBooks custom fields, user-defined columns, and any non-stock schema live in your company file, not ours. The @syntraodbc/codegen CLI introspects your live Syntra instance and emits a project-local typed schema that includes everything.
Run it once, commit the output, and you have the same IntelliSense on your custom columns as you do on the stock ones.
Built for production
Open source, auto-synced, and treated as a first-class surface of Syntra ODBC.
Type-safe tables
Every QuickBooks table and column comes pre-typed. Autocomplete in VS Code, compile-time safety, no schema drift.
Custom fields, too
A codegen CLI introspects your live Syntra instance and emits types for custom fields and user-defined columns.
Zero config
Install one package, import the schema, and query. No post-install step, no runtime introspection, no hidden network calls.
Open source, MIT
Built in public on GitHub. Fork it, audit it, contribute. Auto-synced with every Syntra ODBC release.
Start querying QuickBooks from TypeScript
Install Syntra ODBC, install the npm package, and you are a db.select() away from type-safe QuickBooks queries.