New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vectordb

Package Overview
Dependencies
Maintainers
2
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vectordb - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

6

CHANGELOG.md

@@ -8,2 +8,8 @@ # Changelog

## [0.1.5] - 2023-06-00
### Added
- Support for macOS X86
## [0.1.4] - 2023-06-03

@@ -10,0 +16,0 @@

1

dist/index.d.ts

@@ -169,2 +169,3 @@ import { type Table as ArrowTable } from 'apache-arrow';

filter(value: string): Query<T>;
where: (value: string) => Query<T>;
/** Return only the specified columns.

@@ -171,0 +172,0 @@ *

@@ -156,2 +156,3 @@ "use strict";

constructor(tbl, query, embeddings) {
this.where = this.filter;
this._tbl = tbl;

@@ -158,0 +159,0 @@ this._query = query;

14

dist/test/test.js

@@ -79,10 +79,16 @@ "use strict";

});
it('uses a filter', function () {
it('uses a filter / where clause', function () {
return __awaiter(this, void 0, void 0, function* () {
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const assertResults = (results) => {
chai_1.assert.equal(results.length, 1);
chai_1.assert.equal(results[0].id, 2);
};
const uri = yield createTestDB();
const con = yield lancedb.connect(uri);
const table = yield con.openTable('vectors');
const results = yield table.search([0.1, 0.1]).filter('id == 2').execute();
chai_1.assert.equal(results.length, 1);
chai_1.assert.equal(results[0].id, 2);
let results = yield table.search([0.1, 0.1]).filter('id == 2').execute();
assertResults(results);
results = yield table.search([0.1, 0.1]).where('id == 2').execute();
assertResults(results);
});

@@ -89,0 +95,0 @@ });

{
"name": "vectordb",
"version": "0.1.5",
"version": "0.1.6",
"description": " Serverless, low-latency vector database for AI applications",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -296,2 +296,4 @@ // Copyright 2023 Lance Developers.

where = this.filter
/** Return only the specified columns.

@@ -298,0 +300,0 @@ *

@@ -67,9 +67,16 @@ // Copyright 2023 Lance Developers.

it('uses a filter', async function () {
it('uses a filter / where clause', async function () {
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
const assertResults = (results: Array<Record<string, unknown>>) => {
assert.equal(results.length, 1)
assert.equal(results[0].id, 2)
}
const uri = await createTestDB()
const con = await lancedb.connect(uri)
const table = await con.openTable('vectors')
const results = await table.search([0.1, 0.1]).filter('id == 2').execute()
assert.equal(results.length, 1)
assert.equal(results[0].id, 2)
let results = await table.search([0.1, 0.1]).filter('id == 2').execute()
assertResults(results)
results = await table.search([0.1, 0.1]).where('id == 2').execute()
assertResults(results)
})

@@ -76,0 +83,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc