@onyx.dev/onyx-database 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/edge.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OnyxFacade } from './aggregates-BGXzij4U.cjs';
2
- export { E as FetchImpl, F as FetchResponse, T as ICascadeBuilder, V as ICascadeRelationshipBuilder, M as IConditionBuilder, I as IOnyxDatabase, N as IQueryBuilder, P as ISaveBuilder, L as LogicalOperator, b as OnyxConfig, D as OnyxDocument, H as QueryCondition, G as QueryCriteria, A as QueryCriteriaOperator, K as QueryPage, Q as QueryResults, a as QueryResultsPromise, R as RetryOptions, i as SchemaAttribute, u as SchemaAttributeChange, f as SchemaDataType, z as SchemaDiff, o as SchemaEntity, r as SchemaHistoryEntry, h as SchemaIdentifier, g as SchemaIdentifierGenerator, k as SchemaIndex, v as SchemaIndexChange, j as SchemaIndexType, l as SchemaResolver, w as SchemaResolverChange, q as SchemaRevision, p as SchemaRevisionMetadata, y as SchemaTableDiff, n as SchemaTrigger, x as SchemaTriggerChange, m as SchemaTriggerEvent, s as SchemaUpsertRequest, t as SchemaValidationResult, S as SecretMetadata, c as SecretRecord, e as SecretSaveRequest, d as SecretsListResponse, J as SelectQuery, B as Sort, C as StreamAction, U as UpdateQuery, W as asc, aj as avg, a2 as between, ab as contains, ac as containsIgnoreCase, al as count, X as desc, Y as eq, a3 as gt, a4 as gte, _ as inOp, ah as isNull, a9 as like, as as lower, a5 as lt, a6 as lte, a7 as matches, an as max, aq as median, am as min, Z as neq, ad as notContains, ae as notContainsIgnoreCase, a0 as notIn, aa as notLike, a8 as notMatches, ai as notNull, ag as notStartsWith, a1 as notWithin, av as percentile, au as replace, af as startsWith, ao as std, at as substring, ak as sum, ar as upper, ap as variance, $ as within } from './aggregates-BGXzij4U.cjs';
1
+ import { O as OnyxFacade } from './aggregates-DodZNu9-.cjs';
2
+ export { G as FetchImpl, E as FetchResponse, F as FullTextQuery, V as ICascadeBuilder, W as ICascadeRelationshipBuilder, N as IConditionBuilder, I as IOnyxDatabase, P as IQueryBuilder, T as ISaveBuilder, L as LogicalOperator, b as OnyxConfig, D as OnyxDocument, J as QueryCondition, H as QueryCriteria, A as QueryCriteriaOperator, M as QueryPage, Q as QueryResults, a as QueryResultsPromise, R as RetryOptions, i as SchemaAttribute, u as SchemaAttributeChange, f as SchemaDataType, z as SchemaDiff, o as SchemaEntity, r as SchemaHistoryEntry, h as SchemaIdentifier, g as SchemaIdentifierGenerator, k as SchemaIndex, v as SchemaIndexChange, j as SchemaIndexType, l as SchemaResolver, w as SchemaResolverChange, q as SchemaRevision, p as SchemaRevisionMetadata, y as SchemaTableDiff, n as SchemaTrigger, x as SchemaTriggerChange, m as SchemaTriggerEvent, s as SchemaUpsertRequest, t as SchemaValidationResult, S as SecretMetadata, c as SecretRecord, e as SecretSaveRequest, d as SecretsListResponse, K as SelectQuery, B as Sort, C as StreamAction, U as UpdateQuery, X as asc, al as avg, a3 as between, ad as contains, ae as containsIgnoreCase, an as count, Y as desc, Z as eq, a4 as gt, a5 as gte, $ as inOp, aj as isNull, ab as like, au as lower, a6 as lt, a7 as lte, a8 as matches, ap as max, as as median, ao as min, _ as neq, af as notContains, ag as notContainsIgnoreCase, a1 as notIn, ac as notLike, aa as notMatches, ak as notNull, ai as notStartsWith, a2 as notWithin, ax as percentile, aw as replace, a9 as search, ah as startsWith, aq as std, av as substring, am as sum, at as upper, ar as variance, a0 as within } from './aggregates-DodZNu9-.cjs';
3
3
 
4
4
  declare const onyx: OnyxFacade;
5
5
 
package/dist/edge.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OnyxFacade } from './aggregates-BGXzij4U.js';
2
- export { E as FetchImpl, F as FetchResponse, T as ICascadeBuilder, V as ICascadeRelationshipBuilder, M as IConditionBuilder, I as IOnyxDatabase, N as IQueryBuilder, P as ISaveBuilder, L as LogicalOperator, b as OnyxConfig, D as OnyxDocument, H as QueryCondition, G as QueryCriteria, A as QueryCriteriaOperator, K as QueryPage, Q as QueryResults, a as QueryResultsPromise, R as RetryOptions, i as SchemaAttribute, u as SchemaAttributeChange, f as SchemaDataType, z as SchemaDiff, o as SchemaEntity, r as SchemaHistoryEntry, h as SchemaIdentifier, g as SchemaIdentifierGenerator, k as SchemaIndex, v as SchemaIndexChange, j as SchemaIndexType, l as SchemaResolver, w as SchemaResolverChange, q as SchemaRevision, p as SchemaRevisionMetadata, y as SchemaTableDiff, n as SchemaTrigger, x as SchemaTriggerChange, m as SchemaTriggerEvent, s as SchemaUpsertRequest, t as SchemaValidationResult, S as SecretMetadata, c as SecretRecord, e as SecretSaveRequest, d as SecretsListResponse, J as SelectQuery, B as Sort, C as StreamAction, U as UpdateQuery, W as asc, aj as avg, a2 as between, ab as contains, ac as containsIgnoreCase, al as count, X as desc, Y as eq, a3 as gt, a4 as gte, _ as inOp, ah as isNull, a9 as like, as as lower, a5 as lt, a6 as lte, a7 as matches, an as max, aq as median, am as min, Z as neq, ad as notContains, ae as notContainsIgnoreCase, a0 as notIn, aa as notLike, a8 as notMatches, ai as notNull, ag as notStartsWith, a1 as notWithin, av as percentile, au as replace, af as startsWith, ao as std, at as substring, ak as sum, ar as upper, ap as variance, $ as within } from './aggregates-BGXzij4U.js';
1
+ import { O as OnyxFacade } from './aggregates-DodZNu9-.js';
2
+ export { G as FetchImpl, E as FetchResponse, F as FullTextQuery, V as ICascadeBuilder, W as ICascadeRelationshipBuilder, N as IConditionBuilder, I as IOnyxDatabase, P as IQueryBuilder, T as ISaveBuilder, L as LogicalOperator, b as OnyxConfig, D as OnyxDocument, J as QueryCondition, H as QueryCriteria, A as QueryCriteriaOperator, M as QueryPage, Q as QueryResults, a as QueryResultsPromise, R as RetryOptions, i as SchemaAttribute, u as SchemaAttributeChange, f as SchemaDataType, z as SchemaDiff, o as SchemaEntity, r as SchemaHistoryEntry, h as SchemaIdentifier, g as SchemaIdentifierGenerator, k as SchemaIndex, v as SchemaIndexChange, j as SchemaIndexType, l as SchemaResolver, w as SchemaResolverChange, q as SchemaRevision, p as SchemaRevisionMetadata, y as SchemaTableDiff, n as SchemaTrigger, x as SchemaTriggerChange, m as SchemaTriggerEvent, s as SchemaUpsertRequest, t as SchemaValidationResult, S as SecretMetadata, c as SecretRecord, e as SecretSaveRequest, d as SecretsListResponse, K as SelectQuery, B as Sort, C as StreamAction, U as UpdateQuery, X as asc, al as avg, a3 as between, ad as contains, ae as containsIgnoreCase, an as count, Y as desc, Z as eq, a4 as gt, a5 as gte, $ as inOp, aj as isNull, ab as like, au as lower, a6 as lt, a7 as lte, a8 as matches, ap as max, as as median, ao as min, _ as neq, af as notContains, ag as notContainsIgnoreCase, a1 as notIn, ac as notLike, aa as notMatches, ak as notNull, ai as notStartsWith, a2 as notWithin, ax as percentile, aw as replace, a9 as search, ah as startsWith, aq as std, av as substring, am as sum, at as upper, ar as variance, a0 as within } from './aggregates-DodZNu9-.js';
3
3
 
4
4
  declare const onyx: OnyxFacade;
5
5
 
package/dist/edge.js CHANGED
@@ -1177,6 +1177,14 @@ var OnyxDatabaseImpl = class {
1177
1177
  qb.select(...fields);
1178
1178
  return qb;
1179
1179
  }
1180
+ search(queryText, minScore) {
1181
+ const qb = new QueryBuilderImpl(
1182
+ this,
1183
+ "ALL",
1184
+ this.defaultPartition
1185
+ );
1186
+ return qb.search(queryText, minScore);
1187
+ }
1180
1188
  cascade(...relationships) {
1181
1189
  const cb = new CascadeBuilderImpl(this);
1182
1190
  return cb.cascade(...relationships);
@@ -1463,6 +1471,7 @@ var QueryBuilderImpl = class {
1463
1471
  toSelectQuery() {
1464
1472
  return {
1465
1473
  type: "SelectQuery",
1474
+ table: this.table,
1466
1475
  fields: this.fields,
1467
1476
  conditions: this.serializableConditions(),
1468
1477
  sort: this.sort,
@@ -1502,6 +1511,13 @@ var QueryBuilderImpl = class {
1502
1511
  this.resolvers = flat.length > 0 ? flat : null;
1503
1512
  return this;
1504
1513
  }
1514
+ search(queryText, minScore) {
1515
+ return this.and({
1516
+ field: "__full_text__",
1517
+ operator: "MATCHES",
1518
+ value: { queryText, minScore: minScore ?? null }
1519
+ });
1520
+ }
1505
1521
  where(condition) {
1506
1522
  const c2 = toCondition(condition);
1507
1523
  if (!this.conditions) {
@@ -1853,6 +1869,10 @@ var ConditionBuilderImpl = class {
1853
1869
 
1854
1870
  // src/helpers/conditions.ts
1855
1871
  var c = (field, operator, value) => new ConditionBuilderImpl({ field, operator, value });
1872
+ var fullText = (queryText, minScore) => ({
1873
+ queryText,
1874
+ minScore: minScore ?? null
1875
+ });
1856
1876
  var eq = (field, value) => c(field, "EQUAL", value);
1857
1877
  var neq = (field, value) => c(field, "NOT_EQUAL", value);
1858
1878
  function inOp(field, values) {
@@ -1875,6 +1895,7 @@ var gte = (field, value) => c(field, "GREATER_THAN_EQUAL", value);
1875
1895
  var lt = (field, value) => c(field, "LESS_THAN", value);
1876
1896
  var lte = (field, value) => c(field, "LESS_THAN_EQUAL", value);
1877
1897
  var matches = (field, regex) => c(field, "MATCHES", regex);
1898
+ var search = (queryText, minScore) => c("__full_text__", "MATCHES", fullText(queryText, minScore));
1878
1899
  var notMatches = (field, regex) => c(field, "NOT_MATCHES", regex);
1879
1900
  var like = (field, pattern) => c(field, "LIKE", pattern);
1880
1901
  var notLike = (field, pattern) => c(field, "NOT_LIKE", pattern);
@@ -1906,6 +1927,6 @@ var percentile = (attribute, p) => `percentile(${attribute}, ${p})`;
1906
1927
  var sdkName = "@onyx.dev/onyx-database";
1907
1928
  var sdkVersion = "0.1.0";
1908
1929
 
1909
- export { QueryResults, asc, avg, between, contains, containsIgnoreCase, count, desc, eq, gt, gte, inOp, isNull, like, lower, lt, lte, matches, max, median, min, neq, notContains, notContainsIgnoreCase, notIn, notLike, notMatches, notNull, notStartsWith, notWithin, onyx, percentile, replace, sdkName, sdkVersion, startsWith, std, substring, sum, upper, variance, within };
1930
+ export { QueryResults, asc, avg, between, contains, containsIgnoreCase, count, desc, eq, gt, gte, inOp, isNull, like, lower, lt, lte, matches, max, median, min, neq, notContains, notContainsIgnoreCase, notIn, notLike, notMatches, notNull, notStartsWith, notWithin, onyx, percentile, replace, sdkName, sdkVersion, search, startsWith, std, substring, sum, upper, variance, within };
1910
1931
  //# sourceMappingURL=edge.js.map
1911
1932
  //# sourceMappingURL=edge.js.map