{"id":20770640,"url":"https://github.com/hackolade/sql-select-statement-parser","last_synced_at":"2025-04-30T13:52:38.936Z","repository":{"id":85641682,"uuid":"471009884","full_name":"hackolade/sql-select-statement-parser","owner":"hackolade","description":"Returns object describing columns and tables names used in SQL SELECT query","archived":false,"fork":false,"pushed_at":"2025-02-18T08:37:36.000Z","size":1960,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-30T16:46:27.571Z","etag":null,"topics":["parser","sql"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hackolade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-17T13:38:00.000Z","updated_at":"2025-02-18T08:37:38.000Z","dependencies_parsed_at":"2024-08-02T13:27:20.074Z","dependency_job_id":null,"html_url":"https://github.com/hackolade/sql-select-statement-parser","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackolade%2Fsql-select-statement-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackolade%2Fsql-select-statement-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackolade%2Fsql-select-statement-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackolade%2Fsql-select-statement-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackolade","download_url":"https://codeload.github.com/hackolade/sql-select-statement-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251714939,"owners_count":21631806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parser","sql"],"created_at":"2024-11-17T12:11:02.985Z","updated_at":"2025-04-30T13:52:38.906Z","avatar_url":"https://github.com/hackolade.png","language":"JavaScript","readme":"# SELECT statement SQL parser\n\nDialect-agnostic parser of SQL SELECT statements.\n\nFunction parseSelectStatement accepts SQL SELECT statement of different SQL dialects (MySQL, Oracle, PostgreSQL, T-SQL, Snowflake, etc.) and returns object describing columns and tables names used in the query.\n\n## Installation\n```\nnpm install @hackolade/sql-select-statement-parser\n```\n\n## Usage\n```javascript\nconst result = parseSelectStatement(`\n    SELECT \"database\".'schema'.table.[column] AS columnAlias\n    FROM database.schema.table AS tableAlias;\n`);\n```\n\n## Result structure\n```javascript\n{\n    selectItems: [{                     // array of selected columns and expressions\n        name: \"column\",                 // column name or *\n        tableName: \"table\",             // table name\n        schemaName: \"schema\",           // schema name (or database name for some dialects)\n        databaseName: \"database\",       // database name (if schema also exists in the dialect)\n        originalName: \"[column]\",       // original column name including quotes\n                                        // (or square brackets for T-SQL)\n        alias: \"columnAlias\",           // column alias\n        fieldReferences: [\"column\"],    // List of column names used in expression.\n                                        // Appears only when selected item is\n                                        // described by expression. \n    }],\n    from: [{                            // array of tables described in a FROM clause\n        table: \"table\",                 // table name\n        schemaName: \"schema\",           // schema name (or database name for some dialects)\n        databaseName: \"database\",       // database name (if schema also exists in the dialect)\n        alias: \"tableAlias\",            // table alias\n        originalName: \"`table`\",        // original table name including quotes\n                                        //(or square brackets for T-SQL)\n    }]\n}\n```\n\n## License\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackolade%2Fsql-select-statement-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackolade%2Fsql-select-statement-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackolade%2Fsql-select-statement-parser/lists"}