Registry / database / sql-core

sql-core

JSON →
library0.1.3jsnpmunverified

Core SQL query building utilities for TypeScript projects. Currently at version 0.1.3 with weekly releases. Provides type-safe query construction without runtime dependencies. Differentiates from knex by being more lightweight and TypeScript-first, but is pre-1.0 and should be considered experimental.

npm install sql-core
INSTALL
IMPORT
SIG · SQL-CORE
S
sql-core
databasejavascriptv0.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

QueryBuilder
import { QueryBuilder } from 'query-core'
const { QueryBuilder } = require('query-core')
Package is ESM-only; CommonJS require will fail without dynamic import or bundler support.
sql
import { sql } from 'query-core'
Default export is not available; use named import.
type SqlQuery
import type { SqlQuery } from 'query-core'
import { SqlQuery } from 'query-core'
SqlQuery is a type-only export; use import type for correct tree-shaking.

Shows basic usage of tagged template SQL and query building with the simple API.

import { sql, QueryBuilder } from 'query-core'; const query = sql`SELECT * FROM users WHERE id = ${10}`; const builder = new QueryBuilder(); const result = builder.build(query); console.log(result);
Debug
Known issues
breakingAPI may change significantly before 1.0 release as library is experimental (pre-1.0).
fix
Pin to exact version and lockfile to avoid breaking changes on minor/patch bumps.
affects: <1.0
deprecatedOld import path from 'sql-core' is deprecated in favor of 'query-core'.
fix
Change imports to 'query-core'.
affects: >=0.1
gotchaTemplate literal sql tags do not escape identifiers; only values. Use escapIdentifier() for table/column names.
fix
Use built-in function for identifiers: `sql`SELECT * FROM ${escapIdentifier('users')}`
affects: >=0.1
Errors
Common errors & fixes
Cannot find module 'query-core' or its corresponding type declarations.
Missing installation or TypeScript configuration issue.
fix
Install with `npm install query-core` and ensure tsconfig.json includes `"moduleResolution": "node"` or `"node16"`.
TypeError: query_core_1.sql is not a function
Using default import instead of named import.
fix
Change `import sql from 'query-core'` to `import { sql } from 'query-core'`.
Uncaught SyntaxError: The requested module 'query-core' does not provide an export named 'QueryBuilder'
Importing a type or symbol that doesn't exist in the version.
fix
Check available exports with `import * as qc from 'query-core'` and use correct symbol name.
Upgrade
Version history
0.1.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
12
Meta
1
OpenAI (training)
1
Resources
sql-core — npm install sql-core · libregistry