{"id":42981,"library":"langium-sql","title":"Langium/SQL","description":"Langium/SQL is an extensible language server for SQL dialects built on the Langium framework. It provides schema-driven SQL editing with code completion, syntax highlighting, symbol search, and real-time validation. The current stable version is 0.3.2, released on an irregular cadence. Key differentiators include a super-set approach that allows adding missing dialect features to the grammar while protecting others via validations, and high customizability where any behavior can be overridden. It is designed for integration into editors and IDEs via the Language Server Protocol.","status":"active","version":"0.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/langium/langium-sql","tags":["javascript","typescript"],"install":[{"cmd":"npm install langium-sql","lang":"bash","label":"npm"},{"cmd":"yarn add langium-sql","lang":"bash","label":"yarn"},{"cmd":"pnpm add langium-sql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core language engineering framework for building language servers.","package":"langium","optional":false}],"imports":[{"note":"parseHelper is only exported from the test-utils subpath, not the main package.","wrong":"import { parseHelper } from 'langium-sql';","symbol":"parseHelper","correct":"import { parseHelper } from 'langium-sql/test-utils';"},{"note":"createTestServices is only exported from the test-utils subpath.","wrong":"import { createTestServices } from 'langium-sql';","symbol":"createTestServices","correct":"import { createTestServices } from 'langium-sql/test-utils';"},{"note":"Dialect-specific types are imported from subpaths under dialects/.","wrong":"import { MySqlDialectTypes } from 'langium-sql';","symbol":"MySqlDialectTypes","correct":"import { MySqlDialectTypes } from 'langium-sql/dialects/mysql/data-types';"},{"note":"The main services type is exported from the package root.","wrong":null,"symbol":"LangiumSqlServices","correct":"import { LangiumSqlServices } from 'langium-sql';"}],"quickstart":{"code":"import { createTestServices } from 'langium-sql/test-utils';\nimport { MySqlDialectTypes } from 'langium-sql/dialects/mysql/data-types';\nimport { parseHelper } from 'langium-sql/test-utils';\nimport { join } from 'path';\n\nasync function example() {\n  const services = createTestServices(MySqlDialectTypes);\n  const parse = await parseHelper(services.Sql, join(__dirname, 'schemas.sql'));\n  const document = await parse('SELECT * FROM mytable;');\n  console.log(document.parseResult.value);\n}\n\nexample().catch(console.error);","lang":"typescript","description":"Parses a SQL query using Langium/SQL dialect for MySQL and prints the parse result."},"warnings":[{"fix":"Use import { parseHelper } from 'langium-sql/test-utils'; instead of from 'langium-sql'.","message":"Key utilities parseHelper and createTestServices are not exported from the main package; they must be imported from '/test-utils' subpath.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Update imports to include the full subpath, e.g., 'langium-sql/dialects/mysql/data-types'.","message":"In version 0.2.x, dialect types were exported from the main package. They moved to subpaths in 0.3.0.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Ensure the schema file path is correct and check for validation errors in the returned document.","message":"The parseHelper function expects a path to a schema file; if the file is missing or has errors, parsing fails silently.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Replace createLangiumSqlServices with createTestServices and pass dialect types explicitly.","message":"The services factory 'createLangiumSqlServices' is deprecated in favor of 'createTestServices'.","severity":"deprecated","affected_versions":">=0.3.0"}],"env_vars":null,"search_vec":"'0.3.2':40 'ad':56 'allow':55 'approach':53 'behavior':73 'built':11 'cadenc':45 'code':24 'complet':25 'current':36 'customiz':70 'design':79 'dialect':10,58 'differenti':47 'driven':20 'edit':22 'editor':83 'extens':5 'featur':59 'framework':15 'grammar':62 'high':69 'highlight':27 'ide':85 'includ':48 'integr':81 'irregular':44 'javascript':91 'key':46 'langium':14 'langium/sql':1,2 'languag':6,88 'miss':57 'other':65 'overridden':76 'protect':64 'protocol':90 'provid':17 'real':32 'real-tim':31 'releas':41 'schema':19 'schema-driven':18 'search':29 'server':7,89 'set':52 'sql':9,21 'stabl':37 'super':51 'super-set':50 'symbol':28 'syntax':26 'time':33 'typescript':92 'valid':34,67 'version':38 'via':66,86","created_at":"2026-06-05T16:57:36.468904+00:00","updated_at":"2026-06-05T16:57:36.468904+00:00","problems":[{"fix":"Ensure langium-sql version >= 0.3.0, and verify your bundler or TypeScript resolves subpath exports.","cause":"Missing or incorrect subpath export in package.json; older versions may not expose test-utils.","error":"Cannot find module 'langium-sql/test-utils'"},{"fix":"Use: const parse = await parseHelper(services.Sql, 'schema.sql'); then const doc = await parse('SELECT ...');","cause":"parseHelper is an async function that must be awaited, or imported incorrectly.","error":"TypeError: parseHelper is not a function"},{"fix":"Import from 'langium-sql/dialects/mysql/data-types'.","cause":"MySqlDialectTypes is exported from a subpath, not the main module.","error":"'MySqlDialectTypes' is not exported from 'langium-sql'"}],"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/langium/langium-sql#readme","github":"https://github.com/langium/langium-sql","docs":null,"changelog":null,"pypi":null,"npm":"langium-sql","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"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}}