{"id":19165683,"url":"https://github.com/loopbackio/loopback-connector-dashdb","last_synced_at":"2025-05-07T12:24:15.703Z","repository":{"id":42962887,"uuid":"59030535","full_name":"loopbackio/loopback-connector-dashdb","owner":"loopbackio","description":"Loopback connector for dashDB","archived":false,"fork":false,"pushed_at":"2023-12-15T08:26:26.000Z","size":295,"stargazers_count":2,"open_issues_count":2,"forks_count":8,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-19T22:02:36.110Z","etag":null,"topics":[],"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/loopbackio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-17T14:37:09.000Z","updated_at":"2022-03-23T21:21:46.000Z","dependencies_parsed_at":"2025-04-19T21:44:54.662Z","dependency_job_id":"9f1e53b9-8afd-44e6-97eb-9494a8727612","html_url":"https://github.com/loopbackio/loopback-connector-dashdb","commit_stats":null,"previous_names":["strongloop/loopback-connector-dashdb"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopbackio%2Floopback-connector-dashdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopbackio%2Floopback-connector-dashdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopbackio%2Floopback-connector-dashdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loopbackio%2Floopback-connector-dashdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loopbackio","download_url":"https://codeload.github.com/loopbackio/loopback-connector-dashdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252874879,"owners_count":21817923,"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":[],"created_at":"2024-11-09T09:28:57.926Z","updated_at":"2025-05-07T12:24:15.663Z","avatar_url":"https://github.com/loopbackio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# loopback-connector-dashdb\n\n[IBM® DashDB®]() is the database of choice for robust, enterprise-wide solutions handling high-volume workloads.\nIt is optimized to deliver industry-leading performance while lowering costs.  The `loopback-connector-dashdb`\nmodule is the LoopBack connector for dashDB.\n\nThe LoopBack DashDB connector supports:\n\n- All [CRUD operations](http://loopback.io/doc/en/lb3/Creating-updating-and-deleting-data.html).\n- [Queries](http://loopback.io/doc/en/lb3/Querying-data.html) with fields, limit, order, skip and where filters.\n- All supported DASHDB LUW versions as well as dashDB.  Note for dashDB set supportDashDB in the loopback datasource definition.  Column organized tables are not supported.\n\n## Installation\n\nEnter the following in the top-level directory of your LoopBack application:\n\n```\n$ npm install loopback-connector-dashdb --save\n```\n\nThe `--save` option adds the dependency to the application's `package.json` file.\n\n## Configuration\n\nUse the [data source generator](http://loopback.io/doc/en/lb3/Data-source-generator.html) (`lb datasource`) to add the DASHDB data source to your application.\nThe entry in the application's `server/datasources.json` will look something like this:\n\n```\n\"mydb\": {\n  \"name\": \"mydb\",\n  \"connector\": \"dashdb\"\n}\n```\n\nEdit `server/datasources.json` to add other supported properties as required:\n\n```\n\"mydb\": {\n  \"name\": \"mydb\",\n  \"connector\": \"dashdb\",\n  \"username\": \u003cusername\u003e,\n  \"password\": \u003cpassword\u003e,\n  \"database\": \u003cdatabase name\u003e,\n  \"hostname\": \u003cdashdb server hostname\u003e,\n  \"port\":     \u003cport number\u003e\n}\n```\n\nThe following table describes the connector properties.\n\nProperty       | Type    | Description\n---------------| --------| --------\ndatabase       | String  | Database name\nschema         | String  | Specifies the default schema name that is used to qualify unqualified database objects in dynamically prepared SQL statements. The value of this property sets the value in the CURRENT SCHEMA special register on the database server. The schema name is case-sensitive, and must be specified in uppercase characters\nusername       | String  | DASHDB Username\npassword       | String  | DASHDB password associated with the username above\nhostname       | String  | DASHDB server hostname or IP address\nport           | String  | DASHDB server TCP port number\nuseLimitOffset | Boolean | LIMIT and OFFSET must be configured on the DASHDB server before use (compatibility mode)\nsupportDashDB  | Boolean | Create ROW ORGANIZED tables to support dashDB.\nminPoolSize | Number | Set the minimum size of the connection pool |\nmaxPoolSize | Number | Set the maximum size of the connection pool |\n\n\nAlternatively, you can create and configure the data source in JavaScript code.\nFor example:\n\n```\nvar DataSource = require('loopback-datasource-juggler').DataSource;\nvar DASHDB = require('loopback-connector-dashdb');\n\nvar config = {\n  username: process.env.DASHDB_USERNAME,\n  password: process.env.DASHDB_PASSWORD,\n  hostname: process.env.DASHDB_HOSTNAME,\n  port: 50000,\n  database: 'SQLDB',\n};\n\nvar db = new DataSource(DASHDB, config);\n\nvar User = db.define('User', {\n  name: { type: String },\n  email: { type: String },\n});\n\ndb.autoupdate('User', function(err) {\n  if (err) {\n    console.log(err);\n    return;\n  }\n\n  User.create({\n    name: 'Tony',\n    email: 'tony@t.com',\n  }, function(err, user) {\n    console.log(err, user);\n  });\n\n  User.find({ where: { name: 'Tony' }}, function(err, users) {\n    console.log(err, users);\n  });\n\n  User.destroyAll(function() {\n    console.log('example complete');\n  });\n});\n```\n\n## Operators\n\nHere is a list of operators supported by the connector:\n\n- `regexp` operator\n```js\n  Employee.find({where: {taskCode: {regexp: /tsk/i}}}, function(err, result) {\n    if (err) throw err;\n    console.log('Found instance with regexp: ' + JSON.stringify(result));\n  });\n```\n\n- `like` operator\n```js\n  Employee.find({where: {taskCode: {like: 'TSK%'}}}, function(err, result) {\n    if (err) throw err;\n    console.log('Found instance with like: ' + JSON.stringify(result));\n  });\n```\n\n- `nlike` operator\n```js\n  Employee.find({where: {taskCode: {nlike: 'TSK%'}}}, function(err, result) {\n    if (err) throw err;\n    console.log('Found instance with like: ' + JSON.stringify(result));\n  });\n```\n\n## Running tests\n\n### Own instance\n\nIf you have a local or remote DashDB instance and would like to use that to run the test suite, use the following command:\n- Linux\n```bash\nDASHDB_HOSTNAME=\u003cHOST\u003e DASHDB_PORTNUM=\u003cPORT\u003e DASHDB_USERNAME=\u003cUSER\u003e DASHDB_PASSWORD=\u003cPASSWORD\u003e DASHDB_DATABASE=\u003cDATABASE\u003e DASHDB_SCHEMA=\u003cSCHEMA\u003e CI=true npm test\n```\n- Windows\n```bash\nSET DASHDB_HOSTNAME=\u003cHOST\u003e\nSET DASHDB_PORTNUM=\u003cPORT\u003e\nSET DASHDB_USERNAME=\u003cUSER\u003e\nSET DASHDB_PASSWORD=\u003cPASSWORD\u003e\nSET DASHDB_DATABASE=\u003cDATABASE\u003e\nSET DASHDB_SCHEMA=\u003cSCHEMA\u003e\nSET CI=true\nnpm test\n```\n\nThe value for `DASHDB_SCHEMA` must be of the pattern `SCHEMA{build number}_{build name}_{platform}_{node version}`.\nFor example : **SCHEMA1_DASHDB_DARWIN_10**.\n\nAlternatively, let `DASHDB_SCHEMA` be computed for you by setting these values instead:\n\n```bash\nexport PACKAGE_NAME=loopback-connector-dashdb \nexport BUILD_NUMBER={build number}   For example: 1\nexport nodeVersion={node version}    For example: 10\n```\n\nThis will create a schema with the name: **SCHEMA1_DASHDB_DARWIN_10**\n\nThis pattern of the schema name is important for database **cleanup** and **seeding** purposes.\n\n### Docker\n- DashDB has a docker image which could be signed up for a trial version and be used for testing. For more information, please visit: [DashDB Docker](https://hub.docker.com/r/dashdb/local/)\n- Once the instance is ready, please follow the above information on how to run tests using your [own instance](https://github.com/loopbackio/loopback-connector-dashdb/tree/master#own-instance)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopbackio%2Floopback-connector-dashdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floopbackio%2Floopback-connector-dashdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floopbackio%2Floopback-connector-dashdb/lists"}