{"_id":"pgvector","_rev":"12-651f1baecb764af1a6e1804cb3322815","name":"pgvector","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"pgvector","version":"0.1.0","license":"MIT","_id":"pgvector@0.1.0","maintainers":[{"name":"ankane","email":"andrew@chartkick.com"}],"homepage":"https://github.com/ankane/pgvector-node","bugs":{"url":"https://github.com/ankane/pgvector-node.js/issues"},"dist":{"shasum":"28f149837e2113a1ba6e479bf60dac527a36d9d2","tarball":"https://registry.npmjs.org/pgvector/-/pgvector-0.1.0.tgz","fileCount":9,"integrity":"sha512-rLtD/i425SkdKM91PowcYDbVoQRNBNe5IkVJXeUZiy0EJCLPhdALwidh/PgNU+FqmKncBA8FfdEYnttgBwTHAA==","signatures":[{"sig":"MEYCIQDA9eQZDZNt08pBl+A1EnWZgRLE7T10e8+9QI0wdkhVlAIhAIl0nWJ9thVIJADKtwFcghOjDRQEDZcxLLgNbTr26D/O","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8189,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzRdmCRA9TVsSAnZWagAAFREP/Rt7DT9W8jx4LKGbd4si\nWEJ87aWBHnlt/yT7BXImeVGTyV39jg6dDdLKQzQRXyLXHOpDQhemZ7yJjb+1\nfEoLa59MNklcX+b1m6qKeQ6dLM+PJ4HcNSOXmofR2s0mjhRluZOhDYpZuv/R\nkzj55AUH+qP/Y35XsmgTBc+3hdvfaIBPwJj6GY/Aw2tyobatHV+3uk2MaF+Y\naLexiht4SBCdNVduG/is5Wc/asnLNg3KYsNHyjXhoehjnoyXkYatzO0qMy/r\nNalFdkyt4yvFf9rRFAC5DuDzrmzP6jDJcAdn1qwU3LqD3h88b/gNApSu7q5O\njneIGhpq2iwnvVGKLHwnbpCHOOrliUpx5e5+zHZsbnoHBC10mKyyyOASpslP\nW7cYZzCmOtO9wkets4Zz2q8o+I9Kv/73GHbg5+jkq7aUAQtMk98rJU1mg2wm\n28vfO8U6URzZkjA+KiBp84Lg3VvCrwlspwTxq4bYYmwalj68X+aQ1sXF29Ry\nmw16av+HMjauY8oc0gXx4nGgh7ryrCNRIoal63lDKz499WmAqINL/yDDFWPj\ngwj3h2kZXQbQzAm1n6/OwO4zCkbyk7LdJu/MMpNmI4NSNws4r2tPDguD9q5y\ntGYSOh8Ba9TNOQxG2Q0WarNeCOWHDF8p4PKL1up8IJt2vKa+RYe8gWo0//Im\nfW3f\r\n=X3Xg\r\n-----END PGP SIGNATURE-----\r\n"},"authors":["ankane"],"engines":{"node":">= 12"},"exports":{"./pg":"./pg/index.js","./sequelize":"./sequelize/index.js","./package.json":"./package.json"},"gitHead":"4f95724be480bfec09de49b27b6bb73531d3ea54","scripts":{"test":"jest"},"_npmUser":{"name":"ankane","email":"andrew@chartkick.com"},"repository":{"url":"git+https://github.com/ankane/pgvector-node.js.git","type":"git"},"_npmVersion":"7.11.2","description":"pgvector support for Node.js","directories":{},"_nodeVersion":"16.1.0","_hasShrinkwrap":false,"devDependencies":{"pg":"^8.6.0","jest":"^27.0.4","sequelize":"^6.6.2"},"_npmOperationalInternal":{"tmp":"tmp/pgvector_0.1.0_1624053606231_0.7303178852972037","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"pgvector","version":"0.1.1","license":"MIT","_id":"pgvector@0.1.1","maintainers":[{"name":"ankane","email":"andrew@chartkick.com"}],"homepage":"https://github.com/pgvector/pgvector-node","bugs":{"url":"https://github.com/pgvector/pgvector-node.js/issues"},"dist":{"shasum":"d66e2dd38e746f032a7403ae0312b37ca6c3a2cd","tarball":"https://registry.npmjs.org/pgvector/-/pgvector-0.1.1.tgz","fileCount":8,"integrity":"sha512-+t6CMF+sWONDIPlHyYQZ5shu+5D7m55TbUdspJ2mcCKma9gAlf2q+QBFPJhaxn1d1kHCtOQMhRBlJi1Odd8nHg==","signatures":[{"sig":"MEUCIE1OhluBOBeu1bx9UDsZDxqvFY/YqYZ86UpdL8NkJ+AIAiEAg3BbNpfsoD38cwZOmXg3VIrgPGd8yLv/lj385Lw54xM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJjDPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQ/A//QTSSUAU64H2SF40b4kRnlsfgxYNRe3VurC98J5zAtqR9cQts\r\n6BxXKpAdlZmsAEkxLIiYRWRPVuTqmJPhfHiNvUCn9q/ZcEyJsJwZKxmtG1B4\r\nNNSig0BSQeutuoJ5TMnAZ3lh4BNsVptgJe/+bAFc6pBgHemZl2NsIx0rgRPV\r\nxWaUnZ3ExglNkNDZ8NsZJEFljFiS7ddgz5BtshUHevbjWKNCSDJvdtuRBl23\r\nUqoIEIFT9U+vuOnTN2g82+k7PTwEMH/73m5Da1mTjWHxeTVSBUmwzR0q+gAx\r\n1hud/IAPw8ZcYh2fsQxjwD4vTGIbrMz66NZX5L1l7hVVHpZUdtKevuLc4c3X\r\nNup3rO2wXBIgC968hgjJpJBuLUPOVEqHyCC7bSpRoHprMz6tgVzpTX0nqgz4\r\nxYhQEhfO8eWg26NcwnzsYr9IEzyr0UL6ZE99RozQ2vbbaSzrfzJ5EgFXmJYL\r\nbu7RDzoeKzHdt+H/Dgu5lsY7z31CaFrPjju49/64NeWLx2c3WIbInq5TK2W4\r\nv2PtGKLxo6ifWvkC9AvqDziu9H4F7nMGsnB0pXZ+mB2CSr9AgwARDb25dzCK\r\nOY3HFErsQRP/INLCTHcldbeHFfAUM7gUU0G7eDu6xq6yzAYP/yY0SYJwgmn9\r\nH2cbk3lgPHl8VXzLDqlpJegIUKoiExt0Fpk=\r\n=W5bg\r\n-----END PGP SIGNATURE-----\r\n"},"authors":["ankane"],"engines":{"node":">= 12"},"exports":{"./pg":{"types":"./types/pg/index.d.ts","require":"./pg/index.js"},"./sequelize":{"types":"./types/sequelize/index.d.ts","require":"./sequelize/index.js"},"./package.json":"./package.json"},"gitHead":"8359f54e66bed90dea1a4e24dd2ab9e02a77bd21","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"ankane","email":"andrew@chartkick.com"},"repository":{"url":"git+https://github.com/pgvector/pgvector-node.js.git","type":"git"},"_npmVersion":"9.5.1","description":"pgvector support for Node.js","directories":{},"_nodeVersion":"19.8.1","_hasShrinkwrap":false,"devDependencies":{"pg":"^8.6.0","jest":"^29.5.0","sequelize":"^6.6.2","pg-promise":"^11.4.3","typescript":"^5.0.3"},"_npmOperationalInternal":{"tmp":"tmp/pgvector_0.1.1_1680224463391_0.8250355149958128","host":"s3://npm-registry-packages"}},"0.1.2":{"name":"pgvector","version":"0.1.2","license":"MIT","_id":"pgvector@0.1.2","maintainers":[{"name":"ankane","email":"andrew@chartkick.com"}],"homepage":"https://github.com/pgvector/pgvector-node","bugs":{"url":"https://github.com/pgvector/pgvector-node/issues"},"dist":{"shasum":"8765f87eca72b8b9add6518ea0fd384865de0ff8","tarball":"https://registry.npmjs.org/pgvector/-/pgvector-0.1.2.tgz","fileCount":12,"integrity":"sha512-zpf4zgGhnzNvZ1Yyvw6LHzi9cTkE740ScHHyOLK2kIDHIMllV1x/o/c45kuDnM9M8Rz66Ti44REiTk2aEzRpcg==","signatures":[{"sig":"MEUCIHtKHenZcm8CDjmG4mS5SlOt7NhHBGJTNLIEQRUVji00AiEAq/mgdqOYwG/NZYjkauVNyI3KGKhbQ/0C7iR1124nRuY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11239,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMufdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPxhAAiLDG0HgsD8HquAf0Ag/WvW8HmrOkKdf3pGkZu8zID9zsfaqk\r\nayKbGOfqkHGWmkhGtMPUKGgUq3fOySwaXRrzE1fFrcwx4DHEWfzLrFMsXeUz\r\nw2ZhsUaRCnwO76QyuCgpiYat0qo0EFpw1eCr7mMmdZxcJWDbF5gxz0nQJ2Rr\r\nOB+IOhnUZhzNa3VlOgesvFi2VRm7Kd21lVs4Yf7PvE/9SAzNqv3D2loFI1RX\r\nOqqCPnKCyT/3qvkY80pJ+7vrHCTMtfc0u0lsrkPac0jsVnQ1W9kIFfQJ3/YC\r\n8uoSsHw/r2ZCTaib+f/8nVEQlaUsx5zC5Uv6dqUdZ+ow1BZet1T2w5IPNF6y\r\nI12407hChGBunTUaMIMZmyHgFElsLA5JqyPldw1O15Gqjvvk+pAdenxh1wdp\r\nDaNhWq/d4EU/PpXl9a3errSXejO0andyIx9/PrGXE0+RO/VOLekX4xyb18WN\r\nWjPj4U75KjX0JHtsyoMvqbaLyb4ysgKhtSKd0qpyxkZt5EEk+n6/u2FtCwvG\r\ngEocBvuANzBqf56ZP/sJ1JnWLaC9PdMvS75RailWHHQ/WlrwlHqQVuy1bxIr\r\nDJ+zLkmyN5GYWi7ElMGhpoDwkJZrg0UkxBQAcNJJFc7HpnMSE4EkTKzGT+VV\r\niF4UFpYeYXdXoihn26IVT5CdJVqOMTVUfis=\r\n=YG4o\r\n-----END PGP SIGNATURE-----\r\n"},"authors":["ankane"],"engines":{"node":">= 12"},"exports":{"./pg":{"types":"./types/pg/index.d.ts","require":"./src/pg/index.js"},"./sequelize":{"types":"./types/sequelize/index.d.ts","require":"./src/sequelize/index.js"},"./package.json":"./package.json"},"gitHead":"7553bca3f3f2f72ebf6a3200ca1fd0ff97f8b6ad","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"ankane","email":"andrew@chartkick.com"},"repository":{"url":"git+https://github.com/pgvector/pgvector-node.git","type":"git"},"_npmVersion":"9.5.1","description":"pgvector support for Node.js","directories":{},"_nodeVersion":"19.8.1","_hasShrinkwrap":false,"devDependencies":{"pg":"^8.6.0","jest":"^29.5.0","sequelize":"^6.6.2","pg-promise":"^11.4.3","typescript":"^5.0.3"},"_npmOperationalInternal":{"tmp":"tmp/pgvector_0.1.2_1681057757087_0.651511906954424","host":"s3://npm-registry-packages"}},"0.1.3":{"name":"pgvector","version":"0.1.3","license":"MIT","_id":"pgvector@0.1.3","maintainers":[{"name":"ankane","email":"andrew@chartkick.com"}],"homepage":"https://github.com/pgvector/pgvector-node","bugs":{"url":"https://github.com/pgvector/pgvector-node/issues"},"dist":{"shasum":"423adbacfedf8866b1da2c2675af5c02c2f5ae1c","tarball":"https://registry.npmjs.org/pgvector/-/pgvector-0.1.3.tgz","fileCount":13,"integrity":"sha512-LfCtT7Km+2Nf+ozdob2yshe+7ut8uIrcYYyWDCKkhv/BIqVbN9KeafWGZc8JMD2h09lQhk3rHMH10MhXW0fRbQ==","signatures":[{"sig":"MEUCIQD06K+4UsJxzJYFXuBnPBy0WFTYXL4roIA0oUQcXJjIqQIgJSHZ7bmXrQ9MfElQpdd1u52N2j7nKX71+PE6EFay0Sw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13688,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSG0PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrcsQ//X7n0FMFDfOS6TI1v8Ieh9RipS5afCH4Os8ECDoZZ+MTi30+u\r\n34w76NSWHRqPT5D8TlwbeRnabBdebr7RMG6peWSpugHnYP51pHUEYvqqCUEc\r\n9n4suM9J6t7usrxKVt3m/ZmwYLxOyuHHf+Tmt4YsOZY77Lp0A/0GEh+MtIs1\r\npoRCmazXN8dGGB8tuKSryAvDYOgy0RrxCqGONVtAJrpv2oKijdwI3I0QdidP\r\nuiqmjOixsaojvaeUteK49X/7s6rUlLh8LEM6xnUcEWl+KiOqxmtdoRtiHfyK\r\njQYoaui42VZxYxoz8Xy7xG5Fha4m95QhpWlih7EZAwaeqhtlw0H63oDdG5ib\r\njtqXXsDpWaGuGD2QbLgqz1IAUn2/6YN+DnFnIlye8MmPeTD32aCwPrJJkWLx\r\nASyJanGZ9Gcs8nyIihgT1eD+Zeq3sZgBjhbMt3fqqtk9KeSYK9EUDKGxU4QY\r\nzfrnsVZQLYTUAISwe4Icz//3ES08msd65OKsbGzq/h4OHriEP3Dshw3PH+p7\r\nIy00PIchKHF1ehC2mYszcQ/rBdfZD/MtQWuSrD2eXTe1UcgxqUnmRSm2eHxN\r\nJ/NOBAfAZMQtNX5AesALz0prcot8LbV6XJvy+A108RhgqGad5kHubGPxULuk\r\n43PaoERoAVrm5eWTrmw9onUtYsgtxMGgNaQ=\r\n=+RW+\r\n-----END PGP SIGNATURE-----\r\n"},"authors":["ankane"],"engines":{"node":">= 12"},"exports":{"./pg":{"types":"./types/pg/index.d.ts","require":"./src/pg/index.js"},"./utils":{"types":"./types/utils/index.d.ts","require":"./src/utils/index.js"},"./sequelize":{"types":"./types/sequelize/index.d.ts","require":"./src/sequelize/index.js"},"./package.json":"./package.json"},"gitHead":"0f76246c70a3d9e7ef170806ea1907caddfa908f","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"ankane","email":"andrew@chartkick.com"},"repository":{"url":"git+https://github.com/pgvector/pgvector-node.git","type":"git"},"_npmVersion":"9.5.1","description":"pgvector support for Node.js","directories":{},"_nodeVersion":"19.8.1","_hasShrinkwrap":false,"devDependencies":{"pg":"^8.6.0","jest":"^29.5.0","sequelize":"^6.6.2","pg-promise":"^11.4.3","typescript":"^5.0.3","@prisma/client":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/pgvector_0.1.3_1682468110890_0.874779910474105","host":"s3://npm-registry-packages"}},"0.1.4":{"name":"pgvector","version":"0.1.4","license":"MIT","_id":"pgvector@0.1.4","maintainers":[{"name":"ankane","email":"andrew@chartkick.com"}],"homepage":"https://github.com/pgvector/pgvector-node","bugs":{"url":"https://github.com/pgvector/pgvector-node/issues"},"dist":{"shasum":"b7688e90ca1fc949ace7e52535f670e66b4a7658","tarball":"https://registry.npmjs.org/pgvector/-/pgvector-0.1.4.tgz","fileCount":13,"integrity":"sha512-RjtsAZJOqTme0tk5TRa0sgYnXoYHKf9hembmHjvGc8LmBLHQr3sFpoPEi4WpHONMxvlEv/K9bHC0fzlAEExj1w==","signatures":[{"sig":"MEQCH3s74Wue8tP15Np+bIzfHwcehADhv6pO19aKYGOeAkcCIQDutb4aRpeYUIoiSjyfnMKUXJKVZuGvQgF4HzWeriTdwg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":13660},"authors":["ankane"],"engines":{"node":">= 12"},"exports":{"./pg":{"types":"./types/pg/index.d.ts","default":"./src/pg/index.js"},"./utils":{"types":"./types/utils/index.d.ts","default":"./src/utils/index.js"},"./sequelize":{"types":"./types/sequelize/index.d.ts","default":"./src/sequelize/index.js"},"./package.json":"./package.json"},"gitHead":"dcfadc5c05c93167e072cba4e0af24a6ae4f828a","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"ankane","email":"andrew@chartkick.com"},"repository":{"url":"git+https://github.com/pgvector/pgvector-node.git","type":"git"},"_npmVersion":"9.6.4","description":"pgvector support for Node.js","directories":{},"_nodeVersion":"20.0.0","_hasShrinkwrap":false,"devDependencies":{"pg":"^8.6.0","jest":"^29.5.0","sequelize":"^6.6.2","pg-promise":"^11.4.3","typescript":"^5.0.3","@prisma/client":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/pgvector_0.1.4_1683043790222_0.7936712081443849","host":"s3://npm-registry-packages"}},"0.1.5":{"name":"pgvector","version":"0.1.5","license":"MIT","_id":"pgvector@0.1.5","maintainers":[{"name":"ankane","email":"andrew@chartkick.com"}],"homepage":"https://github.com/pgvector/pgvector-node","bugs":{"url":"https://github.com/pgvector/pgvector-node/issues"},"dist":{"shasum":"13709152456364b5b3fcc661e38ca002aa3d97bb","tarball":"https://registry.npmjs.org/pgvector/-/pgvector-0.1.5.tgz","fileCount":17,"integrity":"sha512-T1SeomH5PkSpMHmnW8CVh6hwjkrjx/xkEMkW0MBFyxMkIEcu6pw5pQW8CNwsVXeJIE3zPdLCqYHqn1GwwT4lXw==","signatures":[{"sig":"MEUCIQCNUv5i4MWyWWiRFy7tRXtIawKE2+mI2gOCiCr/t64PSAIgbx76j2ZUQ2vSaHMRGTF5mekP/mc80nDOQNaxFTwsCxA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":19632},"authors":["ankane"],"engines":{"node":">= 12"},"exports":{"./pg":{"types":"./types/pg/index.d.ts","default":"./src/pg/index.js"},"./utils":{"types":"./types/utils/index.d.ts","default":"./src/utils/index.js"},"./sequelize":{"types":"./types/sequelize/index.d.ts","default":"./src/sequelize/index.js"},"./drizzle-orm":{"types":"./types/drizzle-orm/index.d.ts","default":"./src/drizzle-orm/index.js"},"./package.json":"./package.json"},"gitHead":"fff7de2fff91a8bc94316f1d63004e991ec388d2","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"ankane","email":"andrew@chartkick.com"},"repository":{"url":"git+https://github.com/pgvector/pgvector-node.git","type":"git"},"_npmVersion":"9.8.0","description":"pgvector support for Node.js","directories":{},"_nodeVersion":"20.5.1","typesVersions":{"*":{"pg":["types/pg/index.d.ts"],"utils":["types/utils/index.d.ts"],"sequelize":["types/sequelize/index.d.ts"],"drizzle-orm":["types/drizzle-orm/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"pg":"^8.6.0","jest":"^29.5.0","postgres":"^3.3.4","sequelize":"^6.6.2","pg-promise":"^11.4.3","typescript":"^5.0.3","drizzle-orm":"^0.26.1","@prisma/client":"^4.13.0"},"_npmOperationalInternal":{"tmp":"tmp/pgvector_0.1.5_1692490473430_0.5819067606776163","host":"s3://npm-registry-packages"}},"0.1.6":{"name":"pgvector","version":"0.1.6","license":"MIT","_id":"pgvector@0.1.6","maintainers":[{"name":"ankane","email":"andrew@ankane.org"}],"homepage":"https://github.com/pgvector/pgvector-node","bugs":{"url":"https://github.com/pgvector/pgvector-node/issues"},"dist":{"shasum":"364890582ff260150efdb88f2c3c7e7ebd275a94","tarball":"https://registry.npmjs.org/pgvector/-/pgvector-0.1.6.tgz","fileCount":13,"integrity":"sha512-f6MePi86qj43PiXU5msjPhmVu8pCHDXd1jgQ12mCxVkh+KhX9kEtnejx/FdWii8IP4i8VmDPQ++84OiiNqjQCg==","signatures":[{"sig":"MEYCIQCbno/rMghf9R4d1GxiZnOiTi4Brh33OsFxd0piFIu53gIhAMgIs4fZASIN54h2fRUnVZB7T+1mE/Hi6eAJc4o1feAE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16874},"jest":{"testMatch":["**/*.test.mjs"],"transform":{}},"authors":["ankane"],"engines":{"node":">= 12"},"exports":{"./pg":{"types":"./types/pg/index.d.ts","default":"./src/pg/index.js"},"./knex":{"types":"./types/knex/index.d.ts","default":"./src/knex/index.js"},"./utils":{"types":"./types/utils/index.d.ts","default":"./src/utils/index.js"},"./sequelize":{"types":"./types/sequelize/index.d.ts","default":"./src/sequelize/index.js"},"./drizzle-orm":{"types":"./types/drizzle-orm/index.d.ts","default":"./src/drizzle-orm/index.js"},"./package.json":"./package.json"},"gitHead":"93ff54f69c9c3099c0913f99fdd72bbf647237d4","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest","build":"tsc"},"_npmUser":{"name":"ankane","email":"andrew@ankane.org"},"repository":{"url":"git+https://github.com/pgvector/pgvector-node.git","type":"git"},"_npmVersion":"10.2.4","description":"pgvector support for Node.js (and TypeScript)","directories":{},"_nodeVersion":"21.4.0","typesVersions":{"*":{"pg":["types/pg/index.d.ts"],"knex":["types/knex/index.d.ts"],"utils":["types/utils/index.d.ts"],"sequelize":["types/sequelize/index.d.ts"],"drizzle-orm":["types/drizzle-orm/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"pg":"^8.6.0","jest":"^29.5.0","knex":"^3.1.0","typeorm":"^0.3.17","postgres":"^3.3.4","sequelize":"^6.6.2","pg-promise":"^11.4.3","typescript":"^5.0.3","drizzle-orm":"^0.29.1","@prisma/client":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/pgvector_0.1.6_1702398754352_0.4052840419655839","host":"s3://npm-registry-packages"}},"0.1.7":{"name":"pgvector","version":"0.1.7","license":"MIT","_id":"pgvector@0.1.7","maintainers":[{"name":"ankane","email":"andrew@ankane.org"}],"homepage":"https://github.com/pgvector/pgvector-node","bugs":{"url":"https://github.com/pgvector/pgvector-node/issues"},"dist":{"shasum":"0a170c85da8bae79d79cb09c1968d42d021489f5","tarball":"https://registry.npmjs.org/pgvector/-/pgvector-0.1.7.tgz","fileCount":23,"integrity":"sha512-hl1/Rvvu8iENi/0x4QcZh6o3bF2GWyyKIEu5GfXIzRhzhbOo7aQmoTPNWedRG1pziif+gOMTKKzHaJorgr8F0A==","signatures":[{"sig":"MEQCIBgof2zS+6ziHCNqwcyuOWuBneEdZeWtKTF0cc+4epoYAiBHp5eVxOItUd8GOsMauM3sUXhnehAjV6AGH6FR7wAQPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26338},"jest":{"testMatch":["**/*.test.mjs"],"transform":{}},"authors":["ankane"],"engines":{"node":">= 12"},"exports":{".":{"types":"./types/index.d.ts","default":"./src/index.js"},"./pg":{"types":"./types/pg/index.d.ts","default":"./src/pg/index.js"},"./knex":{"types":"./types/knex/index.d.ts","default":"./src/knex/index.js"},"./utils":{"types":"./types/utils/index.d.ts","default":"./src/utils/index.js"},"./kysely":{"types":"./types/kysely/index.d.ts","default":"./src/kysely/index.js"},"./mikro-orm":{"types":"./types/mikro-orm/index.d.ts","default":"./src/mikro-orm/index.js"},"./objection":{"types":"./types/objection/index.d.ts","default":"./src/objection/index.js"},"./sequelize":{"types":"./types/sequelize/index.d.ts","default":"./src/sequelize/index.js"},"./pg-promise":{"types":"./types/pg-promise/index.d.ts","default":"./src/pg-promise/index.js"},"./drizzle-orm":{"types":"./types/drizzle-orm/index.d.ts","default":"./src/drizzle-orm/index.js"},"./package.json":"./package.json"},"gitHead":"0f98cae3beefaca4301481c2568d744428e50664","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest","build":"tsc"},"_npmUser":{"name":"ankane","email":"andrew@ankane.org"},"repository":{"url":"git+https://github.com/pgvector/pgvector-node.git","type":"git"},"_npmVersion":"10.2.4","description":"pgvector support for Node.js and Bun (and TypeScript)","directories":{},"_nodeVersion":"21.4.0","typesVersions":{"*":{"*":["types/index.d.ts"],"pg":["types/pg/index.d.ts"],"knex":["types/knex/index.d.ts"],"utils":["types/utils/index.d.ts"],"kysely":["types/kysely/index.d.ts"],"mikro-orm":["types/mikro-orm/index.d.ts"],"objection":["types/objection/index.d.ts"],"sequelize":["types/sequelize/index.d.ts"],"pg-promise":["types/pg-promise/index.d.ts"],"drizzle-orm":["types/drizzle-orm/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"pg":"^8.6.0","jest":"^29.5.0","knex":"^3.1.0","kysely":"^0.26.3","typeorm":"^0.3.17","postgres":"^3.3.4","objection":"^3.1.3","sequelize":"^6.6.2","pg-promise":"^11.4.3","typescript":"^5.0.3","drizzle-orm":"^0.29.1","@prisma/client":"^5.7.0","@mikro-orm/core":"^5.9.4","@mikro-orm/postgresql":"^5.9.4"},"_npmOperationalInternal":{"tmp":"tmp/pgvector_0.1.7_1702935519400_0.6121780025172614","host":"s3://npm-registry-packages"}},"0.1.8":{"name":"pgvector","version":"0.1.8","license":"MIT","_id":"pgvector@0.1.8","maintainers":[{"name":"ankane","email":"andrew@ankane.org"}],"homepage":"https://github.com/pgvector/pgvector-node","bugs":{"url":"https://github.com/pgvector/pgvector-node/issues"},"dist":{"shasum":"50c44c7a26b1cb17cf0a001b0772fc0eb5c38762","tarball":"https://registry.npmjs.org/pgvector/-/pgvector-0.1.8.tgz","fileCount":23,"integrity":"sha512-mD6aw+XYJrsuLl3Y8s8gHDDfOZQ9ERtfQPdhvjOrC7eOTM7b6sNkxeZxBhHwUdXMfHmyGWIbwU0QbmSnn7pPmg==","signatures":[{"sig":"MEUCIQDZf3AmgNj5fxN1CeHwku/RQxRYXXl6CJbWzuSXh12ZkgIgVmxQhdI+8F6Q1IxYzU9kMz37cXR3RXXO6IrWo7/5jOQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27602},"jest":{"testMatch":["**/*.test.mjs"],"transform":{}},"authors":["ankane"],"engines":{"node":">= 12"},"exports":{".":{"types":"./types/index.d.ts","default":"./src/index.js"},"./pg":{"types":"./types/pg/index.d.ts","default":"./src/pg/index.js"},"./knex":{"types":"./types/knex/index.d.ts","default":"./src/knex/index.js"},"./utils":{"types":"./types/utils/index.d.ts","default":"./src/utils/index.js"},"./kysely":{"types":"./types/kysely/index.d.ts","default":"./src/kysely/index.js"},"./mikro-orm":{"types":"./types/mikro-orm/index.d.ts","default":"./src/mikro-orm/index.js"},"./objection":{"types":"./types/objection/index.d.ts","default":"./src/objection/index.js"},"./sequelize":{"types":"./types/sequelize/index.d.ts","default":"./src/sequelize/index.js"},"./pg-promise":{"types":"./types/pg-promise/index.d.ts","default":"./src/pg-promise/index.js"},"./drizzle-orm":{"types":"./types/drizzle-orm/index.d.ts","default":"./src/drizzle-orm/index.js"},"./package.json":"./package.json"},"gitHead":"6184d232ee742cbf1a5f28b1873f4a14527b9c8c","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest","build":"tsc"},"_npmUser":{"name":"ankane","email":"andrew@ankane.org"},"repository":{"url":"git+https://github.com/pgvector/pgvector-node.git","type":"git"},"_npmVersion":"10.2.4","description":"pgvector support for Node.js and Bun (and TypeScript)","directories":{},"_nodeVersion":"21.4.0","typesVersions":{"*":{"*":["types/index.d.ts"],"pg":["types/pg/index.d.ts"],"knex":["types/knex/index.d.ts"],"utils":["types/utils/index.d.ts"],"kysely":["types/kysely/index.d.ts"],"mikro-orm":["types/mikro-orm/index.d.ts"],"objection":["types/objection/index.d.ts"],"sequelize":["types/sequelize/index.d.ts"],"pg-promise":["types/pg-promise/index.d.ts"],"drizzle-orm":["types/drizzle-orm/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"pg":"^8.6.0","jest":"^29.5.0","knex":"^3.1.0","kysely":"^0.27.2","slonik":"^37.2.0","typeorm":"^0.3.17","postgres":"^3.3.4","objection":"^3.1.3","sequelize":"^6.6.2","pg-promise":"^11.4.3","typescript":"^5.0.3","drizzle-orm":"^0.29.1","@prisma/client":"^5.7.0","@mikro-orm/core":"^6.1.1","@mikro-orm/postgresql":"^6.1.1"},"_npmOperationalInternal":{"tmp":"tmp/pgvector_0.1.8_1707671928359_0.954172736493015","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"pgvector","version":"0.2.0","license":"MIT","_id":"pgvector@0.2.0","homepage":"https://github.com/pgvector/pgvector-node","bugs":{"url":"https://github.com/pgvector/pgvector-node/issues"},"dist":{"shasum":"3d10f8e7084b4fc849db9acef0930fbbef75d322","tarball":"https://registry.npmjs.org/pgvector/-/pgvector-0.2.0.tgz","fileCount":37,"integrity":"sha512-ef9SggYLzgshzpsFHAha77ghSOucf1ebXcuvokgTQK6V01uihqGJv6i0+U+yjEgiDsiVtTdojDrqOHRcSmcECw==","signatures":[{"sig":"MEUCIEOZYL2unVvqjwDovTXplyAgGQV2BpgEYyIIrf+ebpOCAiEAsoHJecHOmcrvXEq5lJ1ZahHqGbudYciDAgRrHka6t+Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":40325},"jest":{"testMatch":["**/*.test.mjs"],"transform":{}},"authors":["ankane"],"engines":{"node":">= 18"},"exports":{".":{"types":"./types/index.d.ts","default":"./src/index.js"},"./pg":{"types":"./types/pg/index.d.ts","default":"./src/pg/index.js"},"./knex":{"types":"./types/knex/index.d.ts","default":"./src/knex/index.js"},"./utils":{"types":"./types/utils/index.d.ts","default":"./src/utils/index.js"},"./kysely":{"types":"./types/kysely/index.d.ts","default":"./src/kysely/index.js"},"./mikro-orm":{"types":"./types/mikro-orm/index.d.ts","default":"./src/mikro-orm/index.js"},"./objection":{"types":"./types/objection/index.d.ts","default":"./src/objection/index.js"},"./sequelize":{"types":"./types/sequelize/index.d.ts","default":"./src/sequelize/index.js"},"./pg-promise":{"types":"./types/pg-promise/index.d.ts","default":"./src/pg-promise/index.js"},"./package.json":"./package.json"},"gitHead":"26df13855ee700ef751eea56539e22d509a70130","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest","build":"tsc"},"_npmUser":{"name":"ankane","email":"andrew@ankane.org"},"repository":{"url":"git+https://github.com/pgvector/pgvector-node.git","type":"git"},"_npmVersion":"10.7.0","description":"pgvector support for Node.js and Bun (and TypeScript)","directories":{},"_nodeVersion":"22.2.0","typesVersions":{"*":{"*":["types/index.d.ts"],"pg":["types/pg/index.d.ts"],"knex":["types/knex/index.d.ts"],"utils":["types/utils/index.d.ts"],"kysely":["types/kysely/index.d.ts"],"mikro-orm":["types/mikro-orm/index.d.ts"],"objection":["types/objection/index.d.ts"],"sequelize":["types/sequelize/index.d.ts"],"pg-promise":["types/pg-promise/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"pg":"^8.6.0","jest":"^29.5.0","knex":"^3.1.0","kysely":"^0.27.3","slonik":"^43.0.0","typeorm":"^0.3.17","postgres":"^3.3.4","objection":"^3.1.3","sequelize":"^6.6.2","pg-promise":"^11.4.3","typescript":"^5.0.3","drizzle-orm":"^0.31.0","@prisma/client":"^5.7.0","@mikro-orm/core":"^6.1.1","@mikro-orm/postgresql":"^6.1.1"},"_npmOperationalInternal":{"tmp":"tmp/pgvector_0.2.0_1719534254304_0.8402581822086375","host":"s3://npm-registry-packages"}},"0.2.1":{"name":"pgvector","version":"0.2.1","description":"pgvector support for Node.js, Deno, and Bun (and TypeScript)","homepage":"https://github.com/pgvector/pgvector-node","license":"MIT","authors":["ankane"],"repository":{"type":"git","url":"git+https://github.com/pgvector/pgvector-node.git"},"exports":{".":{"types":"./types/index.d.ts","default":"./src/index.js"},"./knex":{"types":"./types/knex/index.d.ts","default":"./src/knex/index.js"},"./kysely":{"types":"./types/kysely/index.d.ts","default":"./src/kysely/index.js"},"./mikro-orm":{"types":"./types/mikro-orm/index.d.ts","default":"./src/mikro-orm/index.js"},"./objection":{"types":"./types/objection/index.d.ts","default":"./src/objection/index.js"},"./pg":{"types":"./types/pg/index.d.ts","default":"./src/pg/index.js"},"./pg-promise":{"types":"./types/pg-promise/index.d.ts","default":"./src/pg-promise/index.js"},"./sequelize":{"types":"./types/sequelize/index.d.ts","default":"./src/sequelize/index.js"},"./utils":{"types":"./types/utils/index.d.ts","default":"./src/utils/index.js"},"./package.json":"./package.json"},"typesVersions":{"*":{"*":["types/index.d.ts"],"knex":["types/knex/index.d.ts"],"kysely":["types/kysely/index.d.ts"],"mikro-orm":["types/mikro-orm/index.d.ts"],"objection":["types/objection/index.d.ts"],"pg":["types/pg/index.d.ts"],"pg-promise":["types/pg-promise/index.d.ts"],"sequelize":["types/sequelize/index.d.ts"],"utils":["types/utils/index.d.ts"]}},"engines":{"node":">= 18"},"scripts":{"build":"tsc","test":"node --test"},"devDependencies":{"@mikro-orm/core":"^6.1.1","@mikro-orm/postgresql":"^6.1.1","@prisma/client":"^6.2.1","drizzle-orm":"^0.43.1","knex":"^3.1.0","kysely":"^0.28.2","objection":"^3.1.3","pg":"^8.6.0","pg-promise":"^11.4.3","postgres":"^3.3.4","sequelize":"^6.6.2","slonik":"^47.1.0","typeorm":"^0.3.17","typescript":"^5.0.3"},"_id":"pgvector@0.2.1","gitHead":"4651bed139870197c5bed4270d234a58ec075e5a","bugs":{"url":"https://github.com/pgvector/pgvector-node/issues"},"_nodeVersion":"23.7.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-nKaQY9wtuiidwLMdVIce1O3kL0d+FxrigCVzsShnoqzOSaWWWOvuctb/sYwlai5cTwwzRSNa+a/NtN2kVZGNJw==","shasum":"5b2c623fedac1cf571519a41be6c12951f6510fa","tarball":"https://registry.npmjs.org/pgvector/-/pgvector-0.2.1.tgz","fileCount":37,"unpackedSize":43120,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCAEttTr55lGek6gxydMwwF7LpjOPo6jpKpf2ai0WRRawIhAMntzjhZ4xqNf3lAt4P0gpNHGh+VK95KAJh8u3IRq23X"}]},"_npmUser":{"name":"ankane","email":"andrew@ankane.org"},"directories":{},"maintainers":[{"name":"ankane","email":"andrew@ankane.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pgvector_0.2.1_1747781575529_0.651156060570814"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-18T22:00:06.231Z","modified":"2025-05-20T22:52:55.943Z","0.1.0":"2021-06-18T22:00:06.397Z","0.1.1":"2023-03-31T01:01:03.534Z","0.1.2":"2023-04-09T16:29:17.240Z","0.1.3":"2023-04-26T00:15:11.066Z","0.1.4":"2023-05-02T16:09:50.366Z","0.1.5":"2023-08-20T00:14:33.620Z","0.1.6":"2023-12-12T16:32:34.523Z","0.1.7":"2023-12-18T21:38:39.591Z","0.1.8":"2024-02-11T17:18:48.518Z","0.2.0":"2024-06-28T00:24:14.534Z","0.2.1":"2025-05-20T22:52:55.729Z"},"bugs":{"url":"https://github.com/pgvector/pgvector-node/issues"},"license":"MIT","homepage":"https://github.com/pgvector/pgvector-node","repository":{"type":"git","url":"git+https://github.com/pgvector/pgvector-node.git"},"description":"pgvector support for Node.js, Deno, and Bun (and TypeScript)","maintainers":[{"name":"ankane","email":"andrew@ankane.org"}],"readme":"# pgvector-node\n\n[pgvector](https://github.com/pgvector/pgvector) support for Node.js, Deno, and Bun (and TypeScript)\n\nSupports [node-postgres](https://github.com/brianc/node-postgres), [Knex.js](https://github.com/knex/knex), [Objection.js](https://github.com/vincit/objection.js), [Kysely](https://github.com/kysely-org/kysely), [Sequelize](https://github.com/sequelize/sequelize), [pg-promise](https://github.com/vitaly-t/pg-promise), [Prisma](https://github.com/prisma/prisma), [Postgres.js](https://github.com/porsager/postgres), [Slonik](https://github.com/gajus/slonik), [TypeORM](https://github.com/typeorm/typeorm), [MikroORM](https://github.com/mikro-orm/mikro-orm), [Drizzle ORM](https://github.com/drizzle-team/drizzle-orm), and [Bun SQL](https://bun.sh/docs/api/sql)\n\n[![Build Status](https://github.com/pgvector/pgvector-node/actions/workflows/build.yml/badge.svg)](https://github.com/pgvector/pgvector-node/actions)\n\n## Installation\n\nRun:\n\n```sh\nnpm install pgvector\n```\n\nAnd follow the instructions for your database library:\n\n- [node-postgres](#node-postgres)\n- [Knex.js](#knexjs)\n- [Objection.js](#objectionjs)\n- [Kysely](#kysely)\n- [Sequelize](#sequelize)\n- [pg-promise](#pg-promise)\n- [Prisma](#prisma)\n- [Postgres.js](#postgresjs)\n- [Slonik](#slonik)\n- [TypeORM](#typeorm)\n- [MikroORM](#mikroorm)\n- [Drizzle ORM](#drizzle-orm)\n- [Bun SQL](#bun-sql)\n\nOr check out some examples:\n\n- [Embeddings](examples/openai/example.js) with OpenAI\n- [Binary embeddings](examples/cohere/example.js) with Cohere\n- [Sentence embeddings](examples/transformers/example.js) with Transformers.js\n- [Hybrid search](examples/hybrid-search/example.js) with Transformers.js\n- [Sparse search](examples/sparse-search/example.js) with Text Embeddings Inference\n- [Morgan fingerprints](examples/rdkit/example.js) with RDKit.js\n- [Recommendations](examples/disco/example.js) with Disco\n- [Horizontal scaling](examples/citus/example.js) with Citus\n- [WebAssembly](examples/pglite/example.js) with PGLite\n- [Bulk loading](examples/loading/example.js) with `COPY`\n\n## node-postgres\n\nEnable the extension\n\n```javascript\nawait client.query('CREATE EXTENSION IF NOT EXISTS vector');\n```\n\nRegister the types for a client\n\n```javascript\nimport pgvector from 'pgvector/pg';\n\nawait pgvector.registerTypes(client);\n```\n\nor a pool\n\n```javascript\npool.on('connect', async function (client) {\n  await pgvector.registerTypes(client);\n});\n```\n\nCreate a table\n\n```javascript\nawait client.query('CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3))');\n```\n\nInsert a vector\n\n```javascript\nawait client.query('INSERT INTO items (embedding) VALUES ($1)', [pgvector.toSql([1, 2, 3])]);\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nconst result = await client.query('SELECT * FROM items ORDER BY embedding <-> $1 LIMIT 5', [pgvector.toSql([1, 2, 3])]);\n```\n\nAdd an approximate index\n\n```javascript\nawait client.query('CREATE INDEX ON items USING hnsw (embedding vector_l2_ops)');\n// or\nawait client.query('CREATE INDEX ON items USING ivfflat (embedding vector_l2_ops) WITH (lists = 100)');\n```\n\nUse `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance\n\nSee a [full example](tests/pg.test.mjs)\n\n## Knex.js\n\nImport the library\n\n```javascript\nimport pgvector from 'pgvector/knex';\n```\n\nEnable the extension\n\n```javascript\nawait knex.schema.createExtensionIfNotExists('vector');\n```\n\nCreate a table\n\n```javascript\nawait knex.schema.createTable('items', (table) => {\n  table.increments('id');\n  table.vector('embedding', 3);\n});\n```\n\nInsert vectors\n\n```javascript\nconst newItems = [\n  {embedding: pgvector.toSql([1, 2, 3])},\n  {embedding: pgvector.toSql([4, 5, 6])}\n];\nawait knex('items').insert(newItems);\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nconst items = await knex('items')\n  .orderBy(knex.l2Distance('embedding', [1, 2, 3]))\n  .limit(5);\n```\n\nAlso supports `maxInnerProduct`, `cosineDistance`, `l1Distance`, `hammingDistance`, and `jaccardDistance`\n\nAdd an approximate index\n\n```javascript\nawait knex.schema.alterTable('items', function (table) {\n  table.index(knex.raw('embedding vector_l2_ops'), 'index_name', 'hnsw');\n});\n```\n\nUse `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance\n\nSee a [full example](tests/knex.test.mjs)\n\n## Objection.js\n\nImport the library\n\n```javascript\nimport pgvector from 'pgvector/objection';\n```\n\nEnable the extension\n\n```javascript\nawait knex.schema.createExtensionIfNotExists('vector');\n```\n\nCreate a table\n\n```javascript\nawait knex.schema.createTable('items', (table) => {\n  table.increments('id');\n  table.vector('embedding', 3);\n});\n```\n\nInsert vectors\n\n```javascript\nconst newItems = [\n  {embedding: pgvector.toSql([1, 2, 3])},\n  {embedding: pgvector.toSql([4, 5, 6])}\n];\nawait Item.query().insert(newItems);\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nimport { l2Distance } from 'pgvector/objection';\n\nconst items = await Item.query()\n  .orderBy(l2Distance('embedding', [1, 2, 3]))\n  .limit(5);\n```\n\nAlso supports `maxInnerProduct`, `cosineDistance`, `l1Distance`, `hammingDistance`, and `jaccardDistance`\n\nAdd an approximate index\n\n```javascript\nawait knex.schema.alterTable('items', function (table) {\n  table.index(knex.raw('embedding vector_l2_ops'), 'index_name', 'hnsw');\n});\n```\n\nUse `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance\n\nSee a [full example](tests/objection.test.mjs)\n\n## Kysely\n\nEnable the extension\n\n```javascript\nawait sql`CREATE EXTENSION IF NOT EXISTS vector`.execute(db);\n```\n\nCreate a table\n\n```javascript\nawait db.schema.createTable('items')\n  .addColumn('id', 'serial', (cb) => cb.primaryKey())\n  .addColumn('embedding', sql`vector(3)`)\n  .execute();\n```\n\nInsert vectors\n\n```javascript\nimport pgvector from 'pgvector/kysely';\n\nconst newItems = [\n  {embedding: pgvector.toSql([1, 2, 3])},\n  {embedding: pgvector.toSql([4, 5, 6])}\n];\nawait db.insertInto('items').values(newItems).execute();\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nimport { l2Distance } from 'pgvector/kysely';\n\nconst items = await db.selectFrom('items')\n  .selectAll()\n  .orderBy(l2Distance('embedding', [1, 2, 3]))\n  .limit(5)\n  .execute();\n```\n\nAlso supports `maxInnerProduct`, `cosineDistance`, `l1Distance`, `hammingDistance`, and `jaccardDistance`\n\nGet items within a certain distance\n\n```javascript\nconst items = await db.selectFrom('items')\n  .selectAll()\n  .where(l2Distance('embedding', [1, 2, 3]), '<', 5)\n  .execute();\n```\n\nAdd an approximate index\n\n```javascript\nawait db.schema.createIndex('index_name')\n  .on('items')\n  .using('hnsw')\n  .expression(sql`embedding vector_l2_ops`)\n  .execute();\n```\n\nUse `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance\n\nSee a [full example](tests/kysely.test.mjs)\n\n## Sequelize\n\nEnable the extension\n\n```javascript\nawait sequelize.query('CREATE EXTENSION IF NOT EXISTS vector');\n```\n\nRegister the types\n\n```javascript\nimport { Sequelize } from 'sequelize';\nimport pgvector from 'pgvector/sequelize';\n\npgvector.registerTypes(Sequelize);\n```\n\nAdd a vector field\n\n```javascript\nconst Item = sequelize.define('Item', {\n  embedding: {\n    type: DataTypes.VECTOR(3)\n  }\n}, ...);\n```\n\nInsert a vector\n\n```javascript\nawait Item.create({embedding: [1, 2, 3]});\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nimport { l2Distance } from 'pgvector/sequelize';\n\nconst items = await Item.findAll({\n  order: l2Distance('embedding', [1, 1, 1], sequelize),\n  limit: 5\n});\n```\n\nAlso supports `maxInnerProduct`, `cosineDistance`, `l1Distance`, `hammingDistance`, and `jaccardDistance`\n\nAdd an approximate index\n\n```javascript\nconst Item = sequelize.define('Item', ..., {\n  indexes: [\n    {\n      fields: ['embedding'],\n      using: 'hnsw',\n      operator: 'vector_l2_ops'\n    }\n  ]\n});\n```\n\nUse `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance\n\nSee a [full example](tests/sequelize.test.mjs)\n\n## pg-promise\n\nEnable the extension\n\n```javascript\nawait db.none('CREATE EXTENSION IF NOT EXISTS vector');\n```\n\nRegister the types\n\n```javascript\nimport pgpromise from 'pg-promise';\nimport pgvector from 'pgvector/pg-promise';\n\nconst initOptions = {\n  async connect(e) {\n    await pgvector.registerTypes(e.client);\n  }\n};\nconst pgp = pgpromise(initOptions);\n```\n\nCreate a table\n\n```javascript\nawait db.none('CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3))');\n```\n\nInsert a vector\n\n```javascript\nawait db.none('INSERT INTO items (embedding) VALUES ($1)', [pgvector.toSql([1, 2, 3])]);\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nconst result = await db.any('SELECT * FROM items ORDER BY embedding <-> $1 LIMIT 5', [pgvector.toSql([1, 2, 3])]);\n```\n\nAdd an approximate index\n\n```javascript\nawait db.none('CREATE INDEX ON items USING hnsw (embedding vector_l2_ops)');\n// or\nawait db.none('CREATE INDEX ON items USING ivfflat (embedding vector_l2_ops) WITH (lists = 100)');\n```\n\nUse `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance\n\nSee a [full example](tests/pg-promise.test.mjs)\n\n## Prisma\n\nNote: `prisma migrate dev` does not support pgvector indexes\n\nImport the library\n\n```javascript\nimport pgvector from 'pgvector';\n```\n\nAdd the extension to the schema\n\n```prisma\ngenerator client {\n  provider        = \"prisma-client-js\"\n  previewFeatures = [\"postgresqlExtensions\"]\n}\n\ndatasource db {\n  provider   = \"postgresql\"\n  url        = env(\"DATABASE_URL\")\n  extensions = [vector]\n}\n```\n\nAdd a vector column to the schema\n\n```prisma\nmodel Item {\n  id        Int                       @id @default(autoincrement())\n  embedding Unsupported(\"vector(3)\")?\n}\n```\n\nInsert a vector\n\n```javascript\nconst embedding = pgvector.toSql([1, 2, 3])\nawait prisma.$executeRaw`INSERT INTO items (embedding) VALUES (${embedding}::vector)`\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nconst embedding = pgvector.toSql([1, 2, 3])\nconst items = await prisma.$queryRaw`SELECT id, embedding::text FROM items ORDER BY embedding <-> ${embedding}::vector LIMIT 5`\n```\n\nSee a [full example](tests/prisma.test.mjs) (and the [schema](prisma/schema.prisma))\n\n## Postgres.js\n\nImport the library\n\n```javascript\nimport pgvector from 'pgvector';\n```\n\nEnable the extension\n\n```javascript\nawait sql`CREATE EXTENSION IF NOT EXISTS vector`;\n```\n\nCreate a table\n\n```javascript\nawait sql`CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3))`;\n```\n\nInsert vectors\n\n```javascript\nconst newItems = [\n  {embedding: pgvector.toSql([1, 2, 3])},\n  {embedding: pgvector.toSql([4, 5, 6])}\n];\nawait sql`INSERT INTO items ${ sql(newItems, 'embedding') }`;\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nconst embedding = pgvector.toSql([1, 2, 3]);\nconst items = await sql`SELECT * FROM items ORDER BY embedding <-> ${ embedding } LIMIT 5`;\n```\n\nAdd an approximate index\n\n```javascript\nawait sql`CREATE INDEX ON items USING hnsw (embedding vector_l2_ops)`;\n// or\nawait sql`CREATE INDEX ON items USING ivfflat (embedding vector_l2_ops) WITH (lists = 100)`;\n```\n\nUse `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance\n\nSee a [full example](tests/postgres.test.mjs)\n\n## Slonik\n\nImport the library\n\n```javascript\nimport pgvector from 'pgvector';\n```\n\nEnable the extension\n\n```javascript\nawait pool.query(sql.unsafe`CREATE EXTENSION IF NOT EXISTS vector`);\n```\n\nCreate a table\n\n```javascript\nawait pool.query(sql.unsafe`CREATE TABLE items (id serial PRIMARY KEY, embedding vector(3))`);\n```\n\nInsert a vector\n\n```javascript\nconst embedding = pgvector.toSql([1, 2, 3]);\nawait pool.query(sql.unsafe`INSERT INTO items (embedding) VALUES (${embedding})`);\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nconst embedding = pgvector.toSql([1, 2, 3]);\nconst items = await pool.query(sql.unsafe`SELECT * FROM items ORDER BY embedding <-> ${embedding} LIMIT 5`);\n```\n\nAdd an approximate index\n\n```javascript\nawait pool.query(sql.unsafe`CREATE INDEX ON items USING hnsw (embedding vector_l2_ops)`);\n// or\nawait pool.query(sql.unsafe`CREATE INDEX ON items USING ivfflat (embedding vector_l2_ops) WITH (lists = 100)`);\n```\n\nUse `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance\n\nSee a [full example](tests/slonik.test.mjs)\n\n## TypeORM\n\nImport the library\n\n```javascript\nimport pgvector from 'pgvector';\n```\n\nEnable the extension\n\n```javascript\nawait AppDataSource.query('CREATE EXTENSION IF NOT EXISTS vector');\n```\n\nCreate a table\n\n```javascript\nawait AppDataSource.query('CREATE TABLE item (id bigserial PRIMARY KEY, embedding vector(3))');\n```\n\nDefine an entity\n\n```typescript\n@Entity()\nclass Item {\n  @PrimaryGeneratedColumn()\n  id: number\n\n  @Column()\n  embedding: string\n}\n```\n\nInsert a vector\n\n```javascript\nconst itemRepository = AppDataSource.getRepository(Item);\nawait itemRepository.save({embedding: pgvector.toSql([1, 2, 3])});\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nconst items = await itemRepository\n  .createQueryBuilder('item')\n  .orderBy('embedding <-> :embedding')\n  .setParameters({embedding: pgvector.toSql([1, 2, 3])})\n  .limit(5)\n  .getMany();\n```\n\nSee a [full example](tests/typeorm.test.mjs)\n\n## MikroORM\n\nEnable the extension\n\n```javascript\nawait em.execute('CREATE EXTENSION IF NOT EXISTS vector');\n```\n\nDefine an entity\n\n```typescript\nimport { VectorType } from 'pgvector/mikro-orm';\n\n@Entity()\nclass Item {\n  @PrimaryKey()\n  id: number;\n\n  @Property({type: VectorType})\n  embedding: number[];\n}\n```\n\nInsert a vector\n\n```javascript\nem.create(Item, {embedding: [1, 2, 3]});\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nimport { l2Distance } from 'pgvector/mikro-orm';\n\nconst items = await em.createQueryBuilder(Item)\n  .orderBy({[l2Distance('embedding', [1, 2, 3])]: 'ASC'})\n  .limit(5)\n  .getResult();\n```\n\nAlso supports `maxInnerProduct`, `cosineDistance`, `l1Distance`, `hammingDistance`, and `jaccardDistance`\n\nSee a [full example](tests/mikro-orm.test.mjs)\n\n## Drizzle ORM\n\nDrizzle ORM 0.31.0+ has [built-in support](https://orm.drizzle.team/docs/extensions/pg#pg_vector) for pgvector :tada:\n\nEnable the extension\n\n```javascript\nawait client`CREATE EXTENSION IF NOT EXISTS vector`;\n```\n\nAdd a vector field\n\n```javascript\nimport { vector } from 'drizzle-orm/pg-core';\n\nconst items = pgTable('items', {\n  id: serial('id').primaryKey(),\n  embedding: vector('embedding', {dimensions: 3})\n});\n```\n\nAlso supports `halfvec`, `bit`, and `sparsevec`\n\nInsert vectors\n\n```javascript\nconst newItems = [\n  {embedding: [1, 2, 3]},\n  {embedding: [4, 5, 6]}\n];\nawait db.insert(items).values(newItems);\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nimport { l2Distance } from 'drizzle-orm';\n\nconst allItems = await db.select()\n  .from(items)\n  .orderBy(l2Distance(items.embedding, [1, 2, 3]))\n  .limit(5);\n```\n\nAlso supports `innerProduct`, `cosineDistance`, `l1Distance`, `hammingDistance`, and `jaccardDistance`\n\nSee a [full example](tests/drizzle-orm.test.mjs)\n\n## Bun SQL\n\nImport the library\n\n```javascript\nimport pgvector from 'pgvector';\n```\n\nEnable the extension\n\n```javascript\nawait sql`CREATE EXTENSION IF NOT EXISTS vector`;\n```\n\nCreate a table\n\n```javascript\nawait sql`CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3))`;\n```\n\nInsert vectors\n\n```javascript\nconst newItems = [\n  {embedding: pgvector.toSql([1, 2, 3])},\n  {embedding: pgvector.toSql([4, 5, 6])}\n];\nawait sql`INSERT INTO items ${sql(newItems)}`;\n```\n\nGet the nearest neighbors to a vector\n\n```javascript\nconst embedding = pgvector.toSql([1, 2, 3]);\nconst items = await sql`SELECT * FROM items ORDER BY embedding <-> ${embedding} LIMIT 5`.values();\n```\n\nAdd an approximate index\n\n```javascript\nawait sql`CREATE INDEX ON items USING hnsw (embedding vector_l2_ops)`;\n// or\nawait sql`CREATE INDEX ON items USING ivfflat (embedding vector_l2_ops) WITH (lists = 100)`;\n```\n\nUse `vector_ip_ops` for inner product and `vector_cosine_ops` for cosine distance\n\nSee a [full example](examples/bun/example.js)\n\n## Reference\n\n### Sparse Vectors\n\nCreate a sparse vector from an array\n\n```javascript\nconst vec = new SparseVector([1, 0, 2, 0, 3, 0]);\n```\n\nOr a map of non-zero elements\n\n```javascript\nconst vec = new SparseVector({0: 1, 2: 2, 4: 3}, 6);\n// or\nconst map = new Map();\nmap.set(0, 1);\nmap.set(2, 2);\nmap.set(4, 3);\nconst vec = new SparseVector(map, 6);\n```\n\nNote: Indices start at 0\n\nGet the number of dimensions\n\n```javascript\nconst dim = vec.dimensions;\n```\n\nGet the indices of non-zero elements\n\n```javascript\nconst indices = vec.indices;\n```\n\nGet the values of non-zero elements\n\n```javascript\nconst values = vec.values;\n```\n\nGet an array\n\n```javascript\nconst arr = vec.toArray();\n```\n\n## History\n\nView the [changelog](https://github.com/pgvector/pgvector-node/blob/master/CHANGELOG.md)\n\n## Contributing\n\nEveryone is encouraged to help improve this project. Here are a few ways you can help:\n\n- [Report bugs](https://github.com/pgvector/pgvector-node/issues)\n- Fix bugs and [submit pull requests](https://github.com/pgvector/pgvector-node/pulls)\n- Write, clarify, or fix documentation\n- Suggest or add new features\n\nTo get started with development:\n\n```sh\ngit clone https://github.com/pgvector/pgvector-node.git\ncd pgvector-node\nnpm install\ncreatedb pgvector_node_test\nnpx prisma migrate dev\nnpm test\n```\n\nTo run an example:\n\n```sh\ncd examples/loading\nnpm install\ncreatedb pgvector_example\nnode example.js\n```\n","readmeFilename":"README.md"}