{"id":37814056,"url":"https://github.com/udaysingh236/odata-sql-connect","last_synced_at":"2026-01-16T15:36:54.648Z","repository":{"id":241387796,"uuid":"804900443","full_name":"udaysingh236/odata-sql-connect","owner":"udaysingh236","description":"A highly versatile, fast and secured OData Version 4.01 SQL Connector which provides functionality to convert different types of OData segments into SQL query statements, that can be executed over an SQL database.","archived":false,"fork":false,"pushed_at":"2024-06-08T11:45:51.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T23:28:02.690Z","etag":null,"topics":["connector","odata-server","odata-service","odatav4","sql"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@slackbyte/odata-sql-connect","language":"TypeScript","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/udaysingh236.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":"2024-05-23T13:42:36.000Z","updated_at":"2024-06-09T09:08:47.000Z","dependencies_parsed_at":"2024-06-08T07:38:35.233Z","dependency_job_id":null,"html_url":"https://github.com/udaysingh236/odata-sql-connect","commit_stats":null,"previous_names":["udaysingh236/odata-sql-connect"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/udaysingh236/odata-sql-connect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaysingh236%2Fodata-sql-connect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaysingh236%2Fodata-sql-connect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaysingh236%2Fodata-sql-connect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaysingh236%2Fodata-sql-connect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/udaysingh236","download_url":"https://codeload.github.com/udaysingh236/odata-sql-connect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/udaysingh236%2Fodata-sql-connect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["connector","odata-server","odata-service","odatav4","sql"],"created_at":"2026-01-16T15:36:53.814Z","updated_at":"2026-01-16T15:36:54.634Z","avatar_url":"https://github.com/udaysingh236.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# odata-sql-connect\n\nA highly versatile, fast and secured OData Version 4.01 SQL Connector which provides functionality to convert different types of OData segments into SQL query statements, that can be executed over an SQL database.\n\n## Potential Usecases\n\n-   Create high speed, Odata 4.01 compliant data sharing APIs.\n-   Can be used over most of the famous Databases like My SQL, My SQL server, Oracle and Postgres.\n\n## Special Unique features\n\n-   Support for Odata V4.01 new features like 'in' operator.\n-   Better and logical support for 'not' expression\n-   By default, strict usage of bind variables or sql pramaters to avoid sql and odata injection.\n-   Database specific SQL query functions gets generated.\n-   Support for almost all the Filter operator.\n-   Support for almost all the Query Functions.\n-   Support for $orderby, $skip, $top, $count, $select.\n-   Better erroring\n\n### Example\n\nMore examples can be [found here](https://github.com/udaysingh236/odata-sql-connect/blob/main/examples/filter.ts)\n\n```Javascript\nimport { odataSql, DbTypes } from '@slackbyte/odata-sql-connect';\n\n// Inpur str for Oracle, Postgres, MySql, MsSql\nimport { orderByStr, stringFuncs, topSkipObj } from '../tests/allTestInOutput';\n\nconst odataSqlPostgres = odataSql({ dbType: DbTypes.PostgreSql });\nconst { error: filterErr, where, parameters } = odataSqlPostgres.createFilter(stringFuncs);\nif (filterErr) {\n    console.error(filterErr.message);\n} else {\n    console.log(`Oracle/Postgres Example =\u003e Where clause: ${where}`);\n    console.log(`Oracle/Postgres Example =\u003e Parameters/Bind Variables: ${Object.fromEntries(parameters)}`);\n}\n\nconst { error: orderByErr, orderBy } = odataSqlPostgres.createOrderBy(orderByStr);\nif (orderByErr) {\n    console.error(orderByErr.message);\n} else {\n    console.log(`Oracle/Postgres Example =\u003e orderBy clause: ${orderBy}`);\n}\n\nconst { error: topSkipErr, top, skip } = odataSqlPostgres.createTopSkip(topSkipObj);\nif (topSkipErr) {\n    console.error(topSkipErr.message);\n} else {\n    console.log(`Oracle/Postgres Example =\u003e Top: ${top}, Skip: ${skip}`);\n}\n\n// FIlter with named parameter prefix\n\nconst odataSqlMsSqlPrefix = odataSql({ dbType: DbTypes.MsSql, namedParamPrefix: 'value' });\nconst { error: filterPrefixErr, where: preWhere, parameters: preParameters } = odataSqlMsSqlPrefix.createFilter(stringFuncs);\nif (filterPrefixErr) {\n    console.error(filterPrefixErr.message);\n} else {\n    console.log(`MsSql Example =\u003e Where clause: ${preWhere}`);\n    console.log(`MsSql Example =\u003e Parameters/Bind Variables: ${Object.fromEntries(preParameters)}`);\n}\n\n// With Raw parameters\n\nconst odataSqlPostgresRaw = odataSql({ dbType: DbTypes.PostgreSql, namedParamPrefix: 'var', useRawParameters: true });\nconst { error: filterRawErr, where: rawWhere, parameters: rawParameters } = odataSqlPostgresRaw.createFilter(stringFuncs);\nif (filterRawErr) {\n    console.error(filterRawErr.message);\n} else {\n    console.log(`Postgres Example =\u003e Where clause: ${rawWhere}`);\n    const valArr = [...rawParameters.values()];\n    console.log(`Postgres Example =\u003e Parameters/Bind Variables Values Array: ${valArr}`);\n    console.log(`Postgres Example =\u003e Parameters/Bind Variables: ${Object.fromEntries(rawParameters)}`);\n}\n\n```\n\n## How to build\n\nTo run the connector in local, please clone the repository and follow the below steps:\n\n```JavaScript\nnpm install\nnpm run dev\n```\n\nTo test and for test coverage:\n\n```JavaScript\nnpm test\nnpm run test:report\n```\n\n## Supported Features\n\n-   [x] $count\n-   [x] $filter\n    -   [x] Comparison Operators\n        -   [x] eq\n        -   [x] ne\n        -   [x] lt\n        -   [x] le\n        -   [x] gt\n        -   [x] ge\n        -   [x] has\n        -   [x] in\n    -   [x] Logical Operators\n        -   [x] and\n        -   [x] or\n        -   [x] not\n    -   [ ] Arithmetic Operators\n        -   [x] add\n        -   [x] sub\n        -   [x] mul\n        -   [x] div\n        -   [ ] divby\n        -   [x] mod\n    -   [x] String Functions\n        -   [x] indexof\n        -   [x] contains\n        -   [x] endswith\n        -   [x] startswith\n        -   [x] length\n        -   [x] substring\n        -   [x] tolower\n        -   [x] toupper\n        -   [x] trim\n        -   [x] concat\n    -   [x] Date Functions\n        -   [x] year\n        -   [x] month\n        -   [x] day\n        -   [x] hour\n        -   [x] minute\n        -   [x] second\n        -   [ ] fractionalseconds\n        -   [x] date\n        -   [x] time\n        -   [ ] totaloffsetminutes\n        -   [x] now\n        -   [ ] mindatetime\n        -   [ ] maxdatetime\n    -   [x] Math Functions\n        -   [x] round\n        -   [x] floor\n        -   [x] ceiling\n    -   [ ] Type and conditional Functions\n        -   [ ] cast\n        -   [ ] isof\n        -   [ ] case\n-   [x] $select\n-   [x] $top\n-   [x] $skip\n-   [x] $orderby\n\n## CONTRIBUTING\n\nI love your inputs! and I want to make your contribution to this project easy and transparent, whether it's:\n\n-   Reporting a bug\n-   Discussing the current state of the code\n-   Submitting a fix\n-   Proposing new features\n\nPlease raise a pull request. 😊\n\nMade with love in INDIA. ❤️\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudaysingh236%2Fodata-sql-connect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fudaysingh236%2Fodata-sql-connect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fudaysingh236%2Fodata-sql-connect/lists"}