{"id":43885,"library":"sql-core","title":"query-core","description":"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.","status":"active","version":"0.1.3","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/core-ts/sql","tags":["javascript","sql","sql-core","query","query-core","typescript"],"install":[{"cmd":"npm install sql-core","lang":"bash","label":"npm"},{"cmd":"yarn add sql-core","lang":"bash","label":"yarn"},{"cmd":"pnpm add sql-core","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is ESM-only; CommonJS require will fail without dynamic import or bundler support.","wrong":"const { QueryBuilder } = require('query-core')","symbol":"QueryBuilder","correct":"import { QueryBuilder } from 'query-core'"},{"note":"Default export is not available; use named import.","symbol":"sql","correct":"import { sql } from 'query-core'"},{"note":"SqlQuery is a type-only export; use import type for correct tree-shaking.","wrong":"import { SqlQuery } from 'query-core'","symbol":"type SqlQuery","correct":"import type { SqlQuery } from 'query-core'"}],"quickstart":{"code":"import { sql, QueryBuilder } from 'query-core';\n\nconst query = sql`SELECT * FROM users WHERE id = ${10}`;\nconst builder = new QueryBuilder();\nconst result = builder.build(query);\nconsole.log(result);","lang":"typescript","description":"Shows basic usage of tagged template SQL and query building with the simple API."},"warnings":[{"fix":"Pin to exact version and lockfile to avoid breaking changes on minor/patch bumps.","message":"API may change significantly before 1.0 release as library is experimental (pre-1.0).","severity":"breaking","affected_versions":"<1.0"},{"fix":"Change imports to 'query-core'.","message":"Old import path from 'sql-core' is deprecated in favor of 'query-core'.","severity":"deprecated","affected_versions":">=0.1"},{"fix":"Use built-in function for identifiers: `sql`SELECT * FROM ${escapIdentifier('users')}`","message":"Template literal sql tags do not escape identifiers; only values. Use escapIdentifier() for table/column names.","severity":"gotcha","affected_versions":">=0.1"}],"env_vars":null,"search_vec":"'-1.0':42 '0.1.3':15 'build':7 'consid':46 'construct':24 'core':3,4,52,56 'current':12 'depend':27 'differenti':28 'experiment':47 'first':38 'javascript':48 'knex':30 'lightweight':34 'pre':41 'project':11 'provid':19 'queri':2,6,23,53,55 'query-cor':1,54 'releas':18 'runtim':26 'safe':22 'sql':5,49,51 'sql-core':50 'type':21 'type-saf':20 'typescript':10,37,57 'typescript-first':36 'util':8 'version':14 'week':17 'without':25","created_at":"2026-06-05T17:01:56.807659+00:00","updated_at":"2026-06-05T17:01:56.807659+00:00","problems":[{"fix":"Install with `npm install query-core` and ensure tsconfig.json includes `\"moduleResolution\": \"node\"` or `\"node16\"`.","cause":"Missing installation or TypeScript configuration issue.","error":"Cannot find module 'query-core' or its corresponding type declarations."},{"fix":"Change `import sql from 'query-core'` to `import { sql } from 'query-core'`.","cause":"Using default import instead of named import.","error":"TypeError: query_core_1.sql is not a function"},{"fix":"Check available exports with `import * as qc from 'query-core'` and use correct symbol name.","cause":"Importing a type or symbol that doesn't exist in the version.","error":"Uncaught SyntaxError: The requested module 'query-core' does not provide an export named 'QueryBuilder'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/core-ts/sql#readme","github":"ssh://git@github.com/core-ts/sql","docs":null,"changelog":null,"pypi":null,"npm":"sql-core","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}