{"id":20745417,"url":"https://github.com/elasticio/mssql-component","last_synced_at":"2025-04-24T06:15:13.763Z","repository":{"id":17384531,"uuid":"81496043","full_name":"elasticio/mssql-component","owner":"elasticio","description":"Microsoft SQL Server integration component for elastic.io platform","archived":false,"fork":false,"pushed_at":"2023-04-06T14:56:53.000Z","size":437,"stargazers_count":0,"open_issues_count":12,"forks_count":8,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-24T06:14:46.868Z","etag":null,"topics":["eio-component","mssql","mssql-ssis"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elasticio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-09T21:21:06.000Z","updated_at":"2023-04-06T14:56:40.000Z","dependencies_parsed_at":"2023-01-11T20:26:32.257Z","dependency_job_id":null,"html_url":"https://github.com/elasticio/mssql-component","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elasticio%2Fmssql-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elasticio%2Fmssql-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elasticio%2Fmssql-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elasticio%2Fmssql-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elasticio","download_url":"https://codeload.github.com/elasticio/mssql-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250573357,"owners_count":21452352,"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":["eio-component","mssql","mssql-ssis"],"created_at":"2024-11-17T07:20:20.798Z","updated_at":"2025-04-24T06:15:13.745Z","avatar_url":"https://github.com/elasticio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/elasticio/mssql-component.svg?style=svg)](https://circleci.com/gh/elasticio/mssql-component)\n# mssql-component \n\u003e elastic.io integration component for Microsoft SQL Server\n\n# mssql-component\nMSSQL Component component for the [elastic.io platform](http://www.elastic.io)\n\n![image](https://user-images.githubusercontent.com/56208/29715706-b4930bdc-89a8-11e7-8a0d-969959d26dd6.png)\n\n## Environment Variables\nNo required Environment Variables.\n\n## Before you Begin\n\nBefore you can deploy any code into elastic.io **you must be a registered elastic.io platform user**. Please see our home page at [http://www.elastic.io](http://www.elastic.io) to learn how. \n\n## Getting Started\n\n### Authentication\n\nYou may use following properties to configure a connection:\n\n![image](https://user-images.githubusercontent.com/40201204/41356042-97e26406-6f2b-11e8-88fb-11cba846d143.png)\n\nother types of configuration parameters are also supported, more infromation and samples you can find [here](https://www.npmjs.com/package/mssql#formats)\n\n### SELECT Trigger and Action\n\nWith this action you may fetch data out of the database, e.g. using ``SELECT`` statement. \n\n![image](https://user-images.githubusercontent.com/56208/29715706-b4930bdc-89a8-11e7-8a0d-969959d26dd6.png)\n\nThis trigger \u0026 action has no limitations on the number of rows so you may expect to get all of these\nvia sequential fetching that is implemented within the node.js ``mssql`` driver.\n\n#### Polling\n\nComponent will remember last execution timestamp and let you build queries on it:\n\n```sql\nselect * from Leads where Created \u003e= '%%EIO_LAST_POLL%%'\n```\n\nwhere just before executing the statement the ``%%EIO_LAST_POLL%%`` will be replaced with ISO Date of the last execution, for example ``2017-08-25T07:43:48.127Z``. During the first execution, date will be equal to [the bigging of time](http://www.onthisday.com/date/1970/january/1) - ``1970-01-01T00:00:00.000Z``.\n\n### INSERT/DELETE/UPDATE Action\n\n![image](https://user-images.githubusercontent.com/56208/29715914-9c369ee0-89a9-11e7-89cb-a559f4a8861f.png)\n\nYou may use this action to do the operations that are not producing output rows but do the database manipulations, \ne.g. ``INSERT``, ``UPDATE`` or ``DELETE`` statements. Internally we use prepared statements, so all incoming data is\nvalidated against SQL injetion, however we had to build a connection from JavaScript types to the MSSQL data types\ntherefore when doing a prepared statements you would need to add ``:type`` to **each prepared statement variable**.\n\nFor example if you have a following SQL statement:\n\n```sql\nINSERT INTO \n  Test2.dbo.Tweets \n(Lang, \"Text\", id, CreatedAt, Username, ScreenName) \nVALUES \n(@lang, @text, @id, @created_at, @username, @screenname)\n```\n\nyou should add ``:type`` to each ``@parameter`` so your SQL query will looks like this:\n\n```sql\nINSERT INTO \n  Test2.dbo.Tweets \n(Lang, \"Text\", id, CreatedAt, Username, ScreenName) \nVALUES \n(@lang, @text, @id:bigint, @created_at:date, @username, @screenname)\n```\n\nFollowing types are supported:\n * ``string`` (also default type if type is omitted)\n * ``number`` (will be converted to MSSQL ``int``)\n * ``bigint``\n * ``boolean`` (will be converted to MSSQL ``bit``)\n * ``float``\n * ``date`` (will be converted to ``DateTime2``)\n * ``money``\n\nmore details can be found [here](https://github.com/elasticio/mssql-component/blob/master/lib/actions/insert.js#L25)\n\nComponent supports dynamic incomig metadata - as soon as your query is in place it will be parsed and incoming metadata will be generated accordingly.\n\n## License\n\nApache-2.0 © [elastic.io GmbH](https://www.elastic.io)\n\n\n[npm-image]: https://badge.fury.io/js/mssql-component.svg\n[npm-url]: https://npmjs.org/package/mssql-component\n[travis-image]: https://travis-ci.org/elasticio/mssql-component.svg?branch=master\n[travis-url]: https://travis-ci.org/elasticio/mssql-component\n[daviddm-image]: https://david-dm.org/elasticio/mssql-component.svg?theme=shields.io\n[daviddm-url]: https://david-dm.org/elasticio/mssql-component\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felasticio%2Fmssql-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felasticio%2Fmssql-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felasticio%2Fmssql-component/lists"}