Setup
Installation and setup is straightforward if you’re using the compiler.
Want to use this with your favourite bundler? See Bundlers and Runtimes for current guidance. That flow avoids writing compiled files directly into your source directory.
-
Install the package:
Terminal window bun add @sqts/coreTerminal window npm install @sqts/coreTerminal window yarn add @sqts/coreTerminal window pnpm add @sqts/core -
Create a
sqts.config.tsfile in your project root:import { defineConfig } from "@sqts/core/config";export default defineConfig({executor: {module: "@sqts/core/adapters/bun-sqlite", // or path/to/my/adapter.ts}}); -
Start writing
.sqtsfiles and runsqts compile.
If you need another database adapter, you can use the list of built-in ones (see sidebar), or write your own. See Custom Adapters for more details.
Disable model types
Section titled “Disable model types”By default, the compiler emits a types file for your models based on your migrations. If you don’t want this, SQTS can fall back on inline types per operation:
import { defineConfig } from "@sqts/core/config";
export default defineConfig({ executor: { module: "@sqts/core/adapters/bun-sqlite", }, compiler: { modelTypes: false }});