Skip to content

Commit

Permalink
release: 0.17.8
Browse files Browse the repository at this point in the history
  • Loading branch information
ppodolsky committed Jul 11, 2023
1 parent 6df9488 commit c4f1609
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 25 deletions.
2 changes: 1 addition & 1 deletion summa-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "summa-core"
version = "0.17.7"
version = "0.17.8"
authors = ["Pasha Podolsky <ppodolsky@me.com>"]
edition = "2021"
license-file = "LICENSE"
Expand Down
6 changes: 3 additions & 3 deletions summa-embed-py/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "summa-embed-py"
version = "0.17.7"
version = "0.17.8"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -17,8 +17,8 @@ pyo3-asyncio = { version = "0.18", features = ["attributes", "tokio-runtime"] }
pyo3-log = "0.8"
pythonize = "0.18"
serde_json = "1.0"
summa-core = { version = "0.17.7", path = "../summa-core", default_features = false, features = ["fs", "hyper-external-request", "tokio-rt"] }
summa-server = { version = "0.17.7", path = "../summa-server", default_features = false }
summa-core = { version = "0.17.8", path = "../summa-core", default_features = false, features = ["fs", "hyper-external-request", "tokio-rt"] }
summa-server = { version = "0.17.8", path = "../summa-server", default_features = false }
summa-proto = { workspace = true }
tantivy = { workspace = true }
tokio = { workspace = true }
6 changes: 3 additions & 3 deletions summa-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "summa-server"
version = "0.17.7"
version = "0.17.8"
license-file = "LICENSE"
description = "Fast full-text search server"
homepage = "https://github.com/izihawa/summa"
Expand Down Expand Up @@ -30,7 +30,7 @@ maintenance = { status = "actively-developed" }
tonic-build = { version = "0.9.1", default-features = false, features = ["prost", "transport"] }

[dev-dependencies]
summa-core = { version = "0.17.7", path = "../summa-core", features = ["fs", "hyper-external-request", "tokio-rt"] }
summa-core = { version = "0.17.8", path = "../summa-core", features = ["fs", "hyper-external-request", "tokio-rt"] }
tempdir = "0.3.7"

[dependencies]
Expand Down Expand Up @@ -59,7 +59,7 @@ serde = { workspace = true }
serde_derive = "1.0"
serde_json = { workspace = true }
serde_yaml = { workspace = true }
summa-core = { version = "0.17.7", path = "../summa-core", features = ["fs", "hyper-external-request", "tokio-rt"] }
summa-core = { version = "0.17.8", path = "../summa-core", features = ["fs", "hyper-external-request", "tokio-rt"] }
summa-proto = { workspace = true, features = ["grpc"] }
take_mut = { workspace = true }
tantivy = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions summa-wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "summa-wasm"
version = "0.125.0"
version = "0.125.2"
authors = ["Pasha Podolsky <ppodolsky@me.com>"]
edition = "2021"
license-file = "LICENSE"
Expand All @@ -26,7 +26,7 @@ prost = { workspace = true }
serde = { workspace = true }
serde-wasm-bindgen = "0.5"
strfmt = { workspace = true }
summa-core = { version = "0.17.7", path = "../summa-core", default_features = false }
summa-core = { version = "0.17.8", path = "../summa-core", default_features = false }
summa-proto = { workspace = true }
tantivy = { workspace = true, features = ["wasm"] }
thiserror = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion summa-wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "summa-wasm",
"description": "WASM-bindings for Summa",
"version": "0.125.0",
"version": "0.125.2",
"keywords": [
"search",
"database",
Expand Down
33 changes: 33 additions & 0 deletions summa-wasm/src/meta-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import Dexie from "dexie";

export class MetaDb extends Dexie {
index_configs!: Dexie.Table<IIndexConfig, string>;
target_version!: number;

constructor(name: string, version: number) {
super(name);
this.target_version = version;
this.version(version).stores({
index_configs: "index_name",
});
Expand All @@ -17,6 +19,37 @@ export class MetaDb extends Dexie {
return this.index_configs.put(item);
});
}

public open() {
if (this.isOpen()) return super.open();
return Dexie.Promise.resolve()
.then(() => Dexie.exists(this.name))
.then((exists) => {
if (!exists) {
// no need to check database version since it doesn't exist
return;
}

// Open separate instance of dexie to get current database version
return new Dexie(this.name).open()
.then(async db => {
if (db.verno >= this.target_version) {
// database up to date (or newer)
return db.close();
}

console.log(`Database schema out of date, resetting all data. (currentVersion: ${db.verno}, expectedVersion: ${this.target_version})`);
await db.delete();

// ensure the deletion was successful
const exists = await Dexie.exists(this.name);
if (exists) {
throw new Error('Failed to remove mock backend database.');
}
})
})
.then(() => super.open());
}
}

interface IIndexConfig {
Expand Down
6 changes: 0 additions & 6 deletions summa-wasm/src/proto.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,6 @@ export namespace summa {

/** QueryParserConfig query_language */
query_language?: (string|null);

/** QueryParserConfig ner_matches_promoter */
ner_matches_promoter?: (summa.proto.INerMatchesPromoter|null);
}

/** Represents a QueryParserConfig. */
Expand Down Expand Up @@ -352,9 +349,6 @@ export namespace summa {
/** QueryParserConfig query_language. */
public query_language?: (string|null);

/** QueryParserConfig ner_matches_promoter. */
public ner_matches_promoter?: (summa.proto.INerMatchesPromoter|null);

/** QueryParserConfig default_mode. */
public default_mode?: ("boolean_should_mode"|"disjuction_max_mode");

Expand Down
9 changes: 0 additions & 9 deletions summa-wasm/src/proto.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ export const summa = $root.summa = (() => {
* @property {Array.<string>|null} [removed_fields] QueryParserConfig removed_fields
* @property {Object.<string,summa.proto.IMorphologyConfig>|null} [morphology_configs] QueryParserConfig morphology_configs
* @property {string|null} [query_language] QueryParserConfig query_language
* @property {summa.proto.INerMatchesPromoter|null} [ner_matches_promoter] QueryParserConfig ner_matches_promoter
*/

/**
Expand Down Expand Up @@ -646,14 +645,6 @@ export const summa = $root.summa = (() => {
*/
QueryParserConfig.prototype.query_language = null;

/**
* QueryParserConfig ner_matches_promoter.
* @member {summa.proto.INerMatchesPromoter|null|undefined} ner_matches_promoter
* @memberof summa.proto.QueryParserConfig
* @instance
*/
QueryParserConfig.prototype.ner_matches_promoter = null;

// OneOf field names bound to virtual getters and setters
let $oneOfFields;

Expand Down

0 comments on commit c4f1609

Please sign in to comment.