{"_id":"@duck-decoy/collections-knex","name":"@duck-decoy/collections-knex","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@duck-decoy/collections-knex","version":"0.2.0","type":"module","description":"Knex-backed RecordCollection for Duck Decoy","license":"MIT","author":{"name":"Sven Johansson"},"main":"./dist/index.js","types":"./dist/index.d.ts","publishConfig":{"access":"public"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"devDependencies":{"@types/node":"^24.2.0","mssql":"^12.2.0","tsup":"^8.5.1","vite-tsconfig-paths":"^5.1.4","vitest":"^3.2.4","duck-decoy":"0.2.0"},"peerDependencies":{"knex":"^3.1.0","duck-decoy":"^0.2.0"},"scripts":{"build":"pnpm typecheck && tsup","ci:test":"vitest run --reporter=dot --no-color","lint":"pnpm exec eslint .","test":"vitest run --reporter verbose","typecheck":"pnpm exec tsc --noEmit"},"_id":"@duck-decoy/collections-knex@0.2.0","_integrity":"sha512-8b67v1/B4J5kqOBcl2rhBEicLu0oYvzqEG4z4VK5Ik8/P1y+3bIj9QZzg74q5CSuvmJJeLDE5N3NfZXiZT/IYw==","_resolved":"/tmp/9a6c173757eff594b96a4024a44759b3/duck-decoy-collections-knex-0.2.0.tgz","_from":"file:duck-decoy-collections-knex-0.2.0.tgz","_nodeVersion":"24.9.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-8b67v1/B4J5kqOBcl2rhBEicLu0oYvzqEG4z4VK5Ik8/P1y+3bIj9QZzg74q5CSuvmJJeLDE5N3NfZXiZT/IYw==","shasum":"31181476ce5f4b1fc6619d549b06fe8383906ee3","tarball":"https://registry.npmjs.org/@duck-decoy/collections-knex/-/collections-knex-0.2.0.tgz","fileCount":7,"unpackedSize":22726,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDS5D1bMwwBfW5SMrXzttT163+JbgKfXkRU00nj8YWIOAiEA8E25NRrzF1h9g8NffTxzKBuxg1dyirAkCQcs3SeoXzo="}]},"_npmUser":{"name":"svjsonx","email":"johansson.sven@gmail.com"},"directories":{},"maintainers":[{"name":"svjsonx","email":"johansson.sven@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/collections-knex_0.2.0_1766442078505_0.6044772801096276"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-22T22:21:18.319Z","0.2.0":"2025-12-22T22:21:18.642Z","modified":"2025-12-22T22:21:19.008Z"},"maintainers":[{"name":"svjsonx","email":"johansson.sven@gmail.com"}],"description":"Knex-backed RecordCollection for Duck Decoy","author":{"name":"Sven Johansson"},"license":"MIT","readme":"\n# Knex Collections for Duck Decoy\n\n[![CI](https://github.com/svjson/duck-decoy/actions/workflows/build-and-test.yaml/badge.svg?branch=master)](https://github.com/svjson/duck-decoy/actions/workflows/build-and-test.yaml)\n[![npm version](https://img.shields.io/npm/v/%40duck-decoy/collections-knex)](https://www.npmjs.com/package/@duck-decoy/collections-knex)\n[![npm downloads](https://img.shields.io/npm/dm/%40duck-decoy/collections-knex)](https://www.npmjs.com/package/@duck-decoy/collections-knex)\n[![GitHub](https://img.shields.io/badge/GitHub-svjson%2Fduck--decoy-blue?logo=github)](https://github.com/svjson/duck-decoy)\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n[![Node](https://img.shields.io/node/v/%40duck-decoy/fastify)](https://www.npmjs.com/package/@duck-decoy/collections-knex)\n\nProvides a [Knex](https://knexjs.org/)-backed `RecordCollection` implementation for Duck Decoy ([GitHub](https://github.com/svjson/duck-decoy/)) ([npmjs.com](https://www.npmjs.com/package/duck-decoy)).\n\n## Usage\n\n```typescript\n    import knex from 'knex'\n    import { KnexCollection } from '@duck-decoy/collections-knex'\n    \n    type CarId = number\n    \n    interface Car {\n      id: CarId\n      type: string\n    }\n    \n    const db = knex({\n       // Connection details\n    })\n    \n    const cars = new KnexCollection<Car, CarId>({\n      knex: db,\n      table: 'cars',\n      records: [{\n        id: 1,\n        type: 'Fast',\n      }, {\n        id: 2,\n        type: 'Really Fast',\n      }, {\n        id: 3,\n        type: 'Not Fast At All'\n      }]\n    })\n```\n","readmeFilename":"README.md","_rev":"1-d1fb357f1157093abcb17d52f237ac73"}