{"_id":"any-db-adapter-spec","_rev":"28-05d72361d35cf219d9da678b01e23347","name":"any-db-adapter-spec","description":"Specification and test suite for any-db adapters","dist-tags":{"latest":"2.3.0"},"versions":{"0.0.0":{"name":"any-db-adapter-spec","version":"0.0.0","description":"Specification and test suite for any-db adapters","main":"test-any-db-adapter.js","bin":{"test-any-db-adapter":"bin/test-any-db-adapter"},"directories":{"test":"tests"},"repository":{"type":"git","url":"https://github.com/grncdr/node-any-db-adapter-spec.git"},"bugs":{"url":"https://github.com/grncdr/node-any-db-adapter-spec/issues"},"dependencies":{"config-chain":"~1.1.8","optimist":"~0.6.0","require-all":"0.0.8","camelize":"~0.1.2","for-each":"~0.1.0","arrayify":"~1.0.0","tape":"~2.3.2"},"devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Stephen Sugden","email":"me@stephensugden.com"},"license":"BSD-2-Clause","_id":"any-db-adapter-spec@0.0.0","dist":{"shasum":"3ecc9326d9e873dbca8e9792363e9e9df5d818ae","tarball":"https://registry.npmjs.org/any-db-adapter-spec/-/any-db-adapter-spec-0.0.0.tgz","integrity":"sha512-ic8/pJPBdaHSsM4isvVybJXEBNZqjFd9608oBQ6jUiFkPtYI515MIfVnTv+9GeoX0CS4bhNevDosAnI3aHJ42A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDajtk7Pl9U/CbAY6mmLiE7AABxMI7TDZ1aGiPYueaVVgIgeG1O11AT9KdHoIfeJvDo6wrrzfXfWkKEwbQ4VaaazxQ="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"grncdr","email":"glurgle@gmail.com"},"maintainers":[{"name":"grncdr","email":"glurgle@gmail.com"}]},"0.0.1":{"name":"any-db-adapter-spec","version":"0.0.1","description":"Specification and test suite for any-db adapters","main":"test-any-db-adapter.js","bin":{"test-any-db-adapter":"bin/test-any-db-adapter"},"directories":{"test":"tests"},"repository":{"type":"git","url":"https://github.com/grncdr/node-any-db-adapter-spec.git"},"bugs":{"url":"https://github.com/grncdr/node-any-db-adapter-spec/issues"},"dependencies":{"config-chain":"~1.1.8","optimist":"~0.6.0","require-all":"0.0.8","camelize":"~0.1.2","for-each":"~0.1.0","arrayify":"~1.0.0","tape":"~2.3.2","parse-db-url":"0.0.0"},"devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Stephen Sugden","email":"me@stephensugden.com"},"license":"BSD-2-Clause","_id":"any-db-adapter-spec@0.0.1","dist":{"shasum":"3e66cd6404f0dc8cf7951f6002ca62afb8ae8c4d","tarball":"https://registry.npmjs.org/any-db-adapter-spec/-/any-db-adapter-spec-0.0.1.tgz","integrity":"sha512-YSrtu42s/qzTCbWsDHEgUNezEx653suTSmWLkkoaZkzh2z6L4ISvfclA6KIk/EfHtabI7P8hO5K2iOA9FdNZUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsXplPx53//zXOO+f1jHojZLYhJwFHgK7RveIshXSVLQIgBDVv3hCVHOSjAgb2sdwBt5Vh4IStQW3FYl21x/44/Js="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"grncdr","email":"glurgle@gmail.com"},"maintainers":[{"name":"grncdr","email":"glurgle@gmail.com"}]},"2.0.2":{"name":"any-db-adapter-spec","version":"2.0.2","description":"Specification and test suite for any-db adapters","main":"test-any-db-adapter.js","bin":{"test-any-db-adapter":"bin/test-any-db-adapter"},"directories":{"test":"tests"},"repository":{"type":"git","url":"https://github.com/grncdr/node-any-db-adapter-spec.git"},"bugs":{"url":"https://github.com/grncdr/node-any-db-adapter-spec/issues"},"dependencies":{"config-chain":"~1.1.8","optimist":"~0.6.0","require-all":"0.0.8","camelize":"~0.1.2","for-each":"~0.1.0","arrayify":"~1.0.0","tape":"~2.3.2","parse-db-url":"0.0.0"},"devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Stephen Sugden","email":"me@stephensugden.com"},"license":"BSD-2-Clause","_id":"any-db-adapter-spec@2.0.2","dist":{"shasum":"c276084f351c59acc42e3c2b4d1576f8a4b7c98a","tarball":"https://registry.npmjs.org/any-db-adapter-spec/-/any-db-adapter-spec-2.0.2.tgz","integrity":"sha512-Ycvxb8vxBWcxIkHJGF6VKBPXtYSpI7lLF0LYba+wKP1G110whdsDO5WL0nuqRxh9dreLR9gt99Pcp405Ek8sZw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFerNR3XYaMQ0K/PkeqfjiMD3Kn2nX4U40P1s1LBP94QIgMeUvaXti59OKwSJBXYQ/3G8KtdKTHhJcktwYjyjEK64="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"grncdr","email":"glurgle@gmail.com"},"maintainers":[{"name":"grncdr","email":"glurgle@gmail.com"}]},"2.0.3":{"name":"any-db-adapter-spec","version":"2.0.3","description":"Specification and test suite for any-db adapters","main":"test-any-db-adapter.js","bin":{"test-any-db-adapter":"bin/test-any-db-adapter"},"directories":{"test":"tests"},"repository":{"type":"git","url":"https://github.com/grncdr/node-any-db-adapter-spec.git"},"bugs":{"url":"https://github.com/grncdr/node-any-db-adapter-spec/issues"},"dependencies":{"config-chain":"~1.1.8","optimist":"~0.6.0","require-all":"0.0.8","camelize":"~0.1.2","for-each":"~0.1.0","arrayify":"~1.0.0","tape":"~2.3.2","parse-db-url":"0.0.0"},"devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Stephen Sugden","email":"me@stephensugden.com"},"license":"BSD-2-Clause","_id":"any-db-adapter-spec@2.0.3","dist":{"shasum":"3f64e4306de5ace5d4628aee56f7e34e0595c16b","tarball":"https://registry.npmjs.org/any-db-adapter-spec/-/any-db-adapter-spec-2.0.3.tgz","integrity":"sha512-IWfdAd64D7i7AWB2ZTzdkgolLUMHQT8RFEW3PefZRH08VpqbTLrA0seyDExkpX5vfGhedHOdIwY0ZWJCa8cqjQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBKedhuGMLh5ObpHyzfG3DpS6SeQQghO0U9lm1nq1J7ZAiAoCACzJ43nWzMi99RJR1jfQQThaPKesqCI7y5q+aI6/g=="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"grncdr","email":"glurgle@gmail.com"},"maintainers":[{"name":"grncdr","email":"glurgle@gmail.com"}]},"2.1.0":{"name":"any-db-adapter-spec","version":"2.1.0","description":"Specification and test suite for any-db adapters","main":"test-any-db-adapter.js","bin":{"test-any-db-adapter":"bin/test-any-db-adapter"},"directories":{"test":"tests"},"repository":{"type":"git","url":"https://github.com/grncdr/node-any-db-adapter-spec.git"},"bugs":{"url":"https://github.com/grncdr/node-any-db-adapter-spec/issues"},"dependencies":{"config-chain":"~1.1.8","optimist":"~0.6.0","require-all":"0.0.8","camelize":"~0.1.2","for-each":"~0.1.0","arrayify":"~1.0.0","tape":"~2.3.2","parse-db-url":"0.0.0"},"devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Stephen Sugden","email":"me@stephensugden.com"},"license":"BSD-2-Clause","_id":"any-db-adapter-spec@2.1.0","dist":{"shasum":"c25e124e64259ec7a0cea47056178dcc1a011464","tarball":"https://registry.npmjs.org/any-db-adapter-spec/-/any-db-adapter-spec-2.1.0.tgz","integrity":"sha512-573PeBokTyHaeHviAnTwQ1RFgel2Fvgv7tDq5cDxRS6JHM2fO06i/G3bdY88iYzb9u/LtW2pBQqCUVxHcbKXDg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRAxDicsyZgV6xWIFc4HuzT7Ml7JwTI4LiAOFglIr8jgIgHolbEuPMeDG5s/NiYNbPClomUJnJmgSV1vBNlxUP5pk="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"grncdr","email":"glurgle@gmail.com"},"maintainers":[{"name":"grncdr","email":"glurgle@gmail.com"}]},"2.1.1":{"name":"any-db-adapter-spec","version":"2.1.1","description":"Specification and test suite for any-db adapters","main":"test-any-db-adapter.js","bin":{"test-any-db-adapter":"bin/test-any-db-adapter"},"directories":{"test":"tests"},"repository":{"type":"git","url":"https://github.com/grncdr/node-any-db-adapter-spec.git"},"bugs":{"url":"https://github.com/grncdr/node-any-db-adapter-spec/issues"},"dependencies":{"config-chain":"~1.1.8","optimist":"~0.6.0","require-all":"0.0.8","camelize":"~0.1.2","for-each":"~0.1.0","arrayify":"~1.0.0","tape":"~2.3.2","parse-db-url":"0.0.0","assert-in-order":"0.0.3"},"devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Stephen Sugden","email":"me@stephensugden.com"},"license":"BSD-2-Clause","_id":"any-db-adapter-spec@2.1.1","dist":{"shasum":"c87cef15bc86e170a2edfb7e895395caacb8896a","tarball":"https://registry.npmjs.org/any-db-adapter-spec/-/any-db-adapter-spec-2.1.1.tgz","integrity":"sha512-oQjkGl5+4zO/g9PnBmsH8EVrZbliRI/mVWyPYMvzt3wtp8VdvWxBGnleEIqffJi3BEGHM5XqZ37M7nMYKAhHYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUXTIezSLgDjzPmUw4nwtsLyZ3qECSayZx/aUxEZhVHAIhAJJ1Idwelud+KIPQ6mQK/sgDwhJvJLg6e7XDGrjMTHdc"}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"grncdr","email":"glurgle@gmail.com"},"maintainers":[{"name":"grncdr","email":"glurgle@gmail.com"}]},"2.1.2":{"name":"any-db-adapter-spec","version":"2.1.2","description":"Specification and test suite for any-db adapters","main":"test-any-db-adapter.js","bin":{"test-any-db-adapter":"bin/test-any-db-adapter"},"directories":{"test":"tests"},"repository":{"type":"git","url":"https://github.com/grncdr/node-any-db-adapter-spec.git"},"bugs":{"url":"https://github.com/grncdr/node-any-db-adapter-spec/issues"},"dependencies":{"config-chain":"~1.1.8","optimist":"~0.6.0","require-all":"0.0.8","camelize":"~0.1.2","for-each":"~0.1.0","arrayify":"~1.0.0","tape":"~2.3.2","parse-db-url":"0.0.0","assert-in-order":"0.0.3"},"devDependencies":{},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Stephen Sugden","email":"me@stephensugden.com"},"license":"BSD-2-Clause","gitHead":"0a825680699b3788a13ec96411deefd521c88826","homepage":"https://github.com/grncdr/node-any-db-adapter-spec","_id":"any-db-adapter-spec@2.1.2","_shasum":"a0703bfae2a36b88aee3f8e9f396ad94f1e8863d","_from":".","_npmVersion":"1.4.20","_npmUser":{"name":"grncdr","email":"glurgle@gmail.com"},"maintainers":[{"name":"grncdr","email":"glurgle@gmail.com"}],"dist":{"shasum":"a0703bfae2a36b88aee3f8e9f396ad94f1e8863d","tarball":"https://registry.npmjs.org/any-db-adapter-spec/-/any-db-adapter-spec-2.1.2.tgz","integrity":"sha512-tIXFXSC1829nmysW6+f1R5Jq0f/2o8wFYRuIF9GGPHtYM44x0CpP0aQxdLrl6Wgxn0m06+wxjX869NGWoyYixw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDq8Qv2pfS0jqxYcblJ1sUfe4FKCepKW7E4oI+c42CAMAIhAMUei2HhSnDTOTZkg3/98yFSbT0iLN8pplZg9Lc3IXiP"}]}},"2.3.0":{"name":"any-db-adapter-spec","version":"2.3.0","description":"Specification and test suite for any-db adapters","main":"test-any-db-adapter.js","bin":{"test-any-db-adapter":"bin/test-any-db-adapter"},"directories":{"test":"tests"},"repository":{"type":"git","url":"git+https://github.com/grncdr/node-any-db-adapter-spec.git"},"bugs":{"url":"https://github.com/grncdr/node-any-db-adapter-spec/issues"},"dependencies":{"arrayify":"~1.0.0","assert-in-order":"0.0.3","camelize":"~0.1.2","config-chain":"~1.1.8","for-each":"~0.1.0","optimist":"~0.6.0","parse-db-url":"2.3.0","require-all":"0.0.8","tape":"~2.3.2"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Stephen Sugden","email":"me@stephensugden.com"},"license":"BSD-2-Clause","homepage":"https://github.com/grncdr/node-any-db-adapter-spec#readme","_id":"any-db-adapter-spec@2.3.0","_nodeVersion":"14.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-R0U5xvwq0fmlg1uo7qPz96748mgEdMeNd5GgJo+XKOkKJ0ky4dIw8Ha9zTWtOYsG5uUEhORT7Eh117DTuNq9OA==","shasum":"837d906d7c5f2f07db0fc6f860fdd40d69c18927","tarball":"https://registry.npmjs.org/any-db-adapter-spec/-/any-db-adapter-spec-2.3.0.tgz","fileCount":19,"unpackedSize":23348,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxivwCRA9TVsSAnZWagAAN1cP/2rOuZSRQYIASlLkkqs0\nAOsFZhnzuut3R8Jqqslyy4Sp0PWk6E+pga5cc/ZGuQewTBckER9zzf5S3olw\nEUiK6Yzl5wmwpBjmefLLvglE/ymEnYRR5ahjmPZqxLpMYXbGjID2ZNhtERg9\nut/lexkDhZdcui6rZTL+FXPNtQB2dZBIiONY+ERnyYKNzhUcUnE2cAZQ2DQ3\ny4nctLsGgug5orrVfW8yudF5mQu4jhpkZyP604f6CX37DSjp236DhchJCrNl\nA/D0LleJhMWXM7Gm0ztlZoRZERYvxewQSceQ5XpAHFvQBEYfBj9QLsRij5/R\n5RC/gxBIln2rNmnaonbi4ezHPyvhDTTmLSheE+mLyefAbdwYqzj2DhP52MMF\nUxSf1IIrqJ5+SQNPiY/T0kUN7u5i4xPXjxD0EbzOPov4+J04NvKGkbCsLWU6\nlbptgB/mqVIBRvN+WT/nr4Q1FjfM7DH/jOI4kljx6HVUb9Y72JmUmKvrqs9Z\nV3xwAz7uNtFxLdS44cScBDeelzKRDCTg1d4q+Iuef/lh4zojDRrym+hDuA8S\nrwBfxOJrdgeqPZ/AIDdiLdwVGgC9g2fDWKQdtk0KpRcJhxI8czLWJ4Oa61wK\nfKVlUg4lNaJJK84shNOzIrrYzMBLBpiqVSNMO0kEhHriAZOSXbaIQVMz4aUv\ncxZ7\r\n=EONy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE4lx355Ve6bOFP0KkAKoH4WKsVgYOj7DiQpg6mYUzf0AiEAqTtmUeYT2D/IXddmD3aMSjVWihqFMf1G7dDCA4XPcW8="}]},"_npmUser":{"name":"grncdr","email":"glurgle@gmail.com"},"maintainers":[{"name":"grncdr","email":"glurgle@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/any-db-adapter-spec_2.3.0_1606822895844_0.4001820661998845"},"_hasShrinkwrap":false}},"readme":"# Any-DB API\n\nThis repo specifies the API that must be implemented by an Any-DB adapter. The\nAPI is described in this README using [jsig][] and prose, and the\n[test suite][] can be used by adapter implementations to ensure they conform.\n\nBecause this documentation is primarily intended for end-users of Any-DB, it\nbegins by describing the objects an adapter must create. The final section\ndescribes the exact API for creating these objects that an adapter must\nimplement.\n\n## Interfaces\n\n- [Queryable][] - a common interface implemented by connections, pools, and\n  transactions.\n- [Connection][] - the \"transport\" responsible for getting SQL queries to a\n  database, and streaming results back through a `Query` instance.\n- [Query][] - a [Readable][] stream that emits row objects.\n\n## Callbacks\n\nAll callbacks used by the API follow convention used in node.js, where first\nparameter is an error (or null) and other parameters (if any) depend on use\ncase.\n\n```ocaml\ntype Continuation<T> : (Error | null, T) => void\n```\n\n## Queryable\n\n```ocaml\nQueryable := EventEmitter & {\n  adapter: Adapter\n  query:   (text: String, params?: Array, Continuation<ResultSet>?) => Query\n  query:   (Query) => Query\n}\n```\n\nKnown implementations:\n\n- [Connection][connection]\n- [ConnectionPool][connectionpool] (external)\n- [Transaction][transaction] (external).\n\n### Queryable.adapter\n\nThe [Adapter][] instance that will be used by this `Queryable` for creating\n[Query][] instances and/or connections.\n\n### Queryable.query\n\n```ocaml\n(text: String, params?: Array, Continuation<ResultSet>?) => Query\n(Query) => Query\n```\n\nExecute a SQL statement using bound parameters (if they are provided) and\nreturn a [Query][] object that is a [Readable][] stream of the resulting\nrows. If a `Continuation<ResultSet>` is provided the rows returned by the\ndatabase will be aggregated into a [ResultSet][] which will be passed to the\ncontinuation after the query has completed.\n\nThe second form is not needed for normal use, but must be implemented by\nadapters to work correctly with [ConnectionPool][] and [Transaction][]. See\n[Adapter.createQuery](#adapter-createquery) for more details.\n\n_Callback-style_\n\n```javascript\nqueryable.query('SELECT * FROM my_table', function(err, res) {\n  if (err) return console.error(err)\n  res.rows.forEach(console.log)\n  console.log('All done!')\n})\n```\n\n_Stream-style_\n\n```javascript\nqueryable\n  .query('SELECT * FROM my_table')\n  .on('error', console.error)\n  .on('data', console.log)\n  .on('end', function() {\n    console.log('All done!')\n  })\n```\n\n### Queryable events\n\n#### Query event\n\nThe `'query'` event is emitted immediately before a query is executed.\n\nOne argument is passed to event handlers:\n\n- `query` - a [Query][] object\n\n## Connection\n\n```ocaml\nConnection := Queryable & {\n  end: (Continuation<void>?) => void\n}\n```\n\nKnown implementations:\n\n- [any-db-mysql][] (external)\n- [any-db-postgres][] (external)\n- [any-db-sqlite3][] (external)\n\nConnection objects are obtained using [createConnection][] from [Any-DB][] or\n[ConnectionPool.acquire][], both of which delegate to the\n[createConnection](#adaptercreateconnection) implementation of the specified\nadapter.\n\nWhile all `Connection` objects implement the [Queryable][] interface, the\nimplementations in each adapter may add additional methods or emit additional\nevents. If you need to access a feature of your database that is not described\nhere (such as Postgres' server-side prepared statements), consult the\ndocumentation for your adapter.\n\n### Connection.end\n\n`(Continuation<void>) => void`\n\nClose the database connection. If a continuation is provided it will be\ncalled after the connection has closed.\n\n### Connection Events\n\n#### Error event\n\nThe `'error'` event is emitted when there is a connection-level error.\n\nNo arguments are passed to event listeners.\n\n#### Open event\n\nThe `'open'` event is emitted when the connection has been established and is\nready to query.\n\nNo arguments are passed to event listeners.\n\n#### Close event\n\nThe `'close'` event is emitted when the connection has been closed.\n\nNo arguments are passed to event listeners.\n\n## Query\n\n```ocaml\nQuery := Readable<Object> & {\n  text: String,\n  values?: Array,\n  callback?: Continuation<ResultSet>\n}\n```\n\n`Query` objects are returned by the [Queryable.query][queryable.query] method,\navailable on [connections][connection], [pools][connectionpool.query], and\n[transactions][transaction.query]. Queries are instances of [Readable][], and\nas such can be [piped][readable.pipe] through transforms and support backpressure\nfor more efficient memory-usage on very large results sets. (Note: at this time\nthe `sqlite3` driver does not support backpressure)\n\nInternally, `Query` instances are\n[created by a database Adapter][adapter.createquery] and may have more methods,\nproperties, and events than are described here. Consult the documentation for\nyour specific adapter to find out about any extensions.\n\n### Query.text\n\nThe SQL query as a string. If you are using MySQL this will contain\ninterpolated values _after_ the query has been enqueued by a connection.\n\n### Query.values\n\nThe array of parameter values.\n\n### Query.callback\n\nThe callback (if any) that was provided to [Queryable.query][queryable.query].\nNote that `Query` objects **must not** use a closed over reference to their\ncallback, as other `any-db` libraries _may_ rely on modifying the `callback`\nproperty of a `Query` they did not create.\n\n### Query Events\n\n#### Error event\n\nThe `'error'` event is emitted at most once per query. Note that this event will\nbe emitted for errors even if a callback was provided, the callback will simply\nbe subscribed to the `'error'` event.\n\nOne argument is passed to event listeners:\n\n- `error` - the error object.\n\n#### Fields event\n\nA `'fields'` event is emmitted before any `'data'` events.\n\nOne argument is passed to event listeners:\n\n- `fields` - an array of [Field][resultset] objects.\n\n### [Readable][] events\n\nThe following events are part of the [Readable][] interface which is implemented by Query:\n\n#### Data event\n\nA `'data'` event is emitted for each row in the query result set.\n\nOne argument is passed to event listeners:\n\n- `row` contains the contents of a single row in the query result\n\n#### Close event\n\nA `'close'` event is emitted when the query completes.\n\nNo arguments are passed to event listeners.\n\n#### End event\n\nAn `'end'` event is emitted after all query results have been consumed.\n\nNo arguments are passed to event listeners.\n\n## ResultSet\n\n```ocaml\nResultSet := {\n  fields:        Array<Field>\n  rows:          Array<Object<Any>>\n  rowCount:      Integer\n  lastInsertId?: Any\n}\n\nField := {\n  name: String\n  {* other properties are driver specific *}\n}\n```\n\n`ResultSet` objects are just plain data that collect results of a query when a\ncontinuation is provided to [Queryable.query][]. The `lastInsertId` is optional,\nand currently supported by `sqlite3` and `mysql` but not `postgres`, because\nit is not supported by Postgres itself.\n\n## Adapter\n\n```ocaml\nAdapter: {\n  name:             String\n  createConnection: (Object, Continuation<Connection>?) => Connection,\n  createQuery:      (String, Array?, Continuation<ResultSet>?) => Query,\n}\n```\n\nThis section is mostly intended for adapter authors, other users should rarely\nneed to interact with this API directly.\n\n### Adapter.name\n\nThe string name of the adapter, e.g. `'mysql'`, `'postgres'` or `'sqlite3'`.\n\n### Adapter.createConnection\n\n`(config: Object, Continuation<Connection>?) => Connection`\n\nCreate a new connection object. In common usage, `config` will be created by\n[parse-db-url][] and passed to the adapter by [any-db][].\n\nIf a continuation is given, it **must** be called, either with an error or the\nestablished connection.\n\nSee also: the [Connection API](#connection)\n\n### Adapter.createQuery\n\n```ocaml\n(text: String, params?: Array, Continuation<ResultSet>?) => Query\n(Query) => Query {* returns same Query *}\n```\n\nCreate a [Query](#query) that _may_ eventually be executed later on by a\n[Connection][]. While this function is rarely needed by user code, it makes\nit possible for [ConnectionPool.query][] and [Transaction.query][] to fulfill\nthe [Queryable.query][] contract by synchronously returning a [Query][] stream.\n\n# License\n\n2-clause BSD\n\n[jsig]: https://github.com/jden/jsig\n[once]: http://npm.im/once\n[parse-db-url]: https://github.com/grncdr/parse-db-url#api\n[any-db]: https://github.com/grncdr/node-any-db\n[any-db-mysql]: https://github.com/grncdr/node-any-db-mysql\n[any-db-postgres]: https://github.com/grncdr/node-any-db-postgres\n[any-db-sqlite3]: https://github.com/grncdr/node-any-db-sqlite3\n[createconnection]: https://github.com/grncdr/node-any-db#exportscreateconnection\n[readable]: http://nodejs.org/api/stream.html#stream_class_stream_readable\n[readable.pipe]: http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options\n[connectionpool.query]: https://github.com/grncdr/node-any-db-pool#connectionpoolquery\n[connectionpool.acquire]: https://github.com/grncdr/node-any-db-pool#connectionpoolacquire\n[connectionpool]: https://github.com/grncdr/node-any-db-pool#api\n[transaction]: https://github.com/grncdr/node-any-db-transaction#api\n[any-db-transaction]: https://github.com/grncdr/node-any-db-transaction\n[transaction.query]: https://github.com/grncdr/node-any-db-transaction#transactionquery\n[test suite]: tests\n[adapter]: #adapter\n[queryable]: #queryable\n[queryable.query]: #queryablequery\n[connection]: #connection\n[connection.query]: #connectionquery\n[query]: #query\n[adapter.createquery]: #adaptercreatequery\n","maintainers":[{"name":"grncdr","email":"glurgle@gmail.com"}],"time":{"modified":"2022-06-13T03:07:12.442Z","created":"2013-12-22T00:19:58.297Z","0.0.0":"2013-12-22T00:20:01.036Z","0.0.1":"2013-12-22T04:02:41.350Z","2.0.0":"2013-12-24T09:42:28.011Z","2.0.1":"2013-12-24T19:36:39.997Z","2.0.2":"2013-12-25T02:38:48.084Z","2.0.3":"2013-12-25T10:07:06.270Z","2.1.0":"2013-12-26T08:25:53.733Z","2.1.1":"2014-02-17T07:33:07.568Z","2.1.2":"2014-07-13T11:29:49.020Z","2.3.0":"2020-12-01T11:41:36.001Z"},"author":{"name":"Stephen Sugden","email":"me@stephensugden.com"},"repository":{"type":"git","url":"git+https://github.com/grncdr/node-any-db-adapter-spec.git"},"readmeFilename":"README.md","homepage":"https://github.com/grncdr/node-any-db-adapter-spec#readme","bugs":{"url":"https://github.com/grncdr/node-any-db-adapter-spec/issues"},"license":"BSD-2-Clause"}