@electric-sql/client
Advanced tools
Comparing version 0.6.2 to 0.6.3
@@ -130,6 +130,11 @@ /** | ||
/** | ||
* where clauses for the shape. | ||
* The where clauses for the shape. | ||
*/ | ||
where?: string; | ||
/** | ||
* The columns to include in the shape. | ||
* Must include primary keys, and can only inlude valid columns. | ||
*/ | ||
columns?: string[]; | ||
/** | ||
* The "offset" on the shape log. This is typically not set as the ShapeStream | ||
@@ -136,0 +141,0 @@ * will handle this automatically. A common scenario where you might pass an offset |
@@ -207,2 +207,3 @@ var __defProp = Object.defineProperty; | ||
var WHERE_QUERY_PARAM = `where`; | ||
var COLUMNS_QUERY_PARAM = `columns`; | ||
var LIVE_QUERY_PARAM = `live`; | ||
@@ -410,3 +411,3 @@ | ||
__privateSet(this, _isUpToDate, false); | ||
const { url, where, signal } = this.options; | ||
const { url, where, columns, signal } = this.options; | ||
try { | ||
@@ -416,2 +417,4 @@ while (!(signal == null ? void 0 : signal.aborted) && !__privateGet(this, _isUpToDate) || this.options.subscribe) { | ||
if (where) fetchUrl.searchParams.set(WHERE_QUERY_PARAM, where); | ||
if (columns && columns.length > 0) | ||
fetchUrl.searchParams.set(COLUMNS_QUERY_PARAM, columns.join(`,`)); | ||
fetchUrl.searchParams.set(OFFSET_QUERY_PARAM, __privateGet(this, _lastOffset)); | ||
@@ -418,0 +421,0 @@ if (__privateGet(this, _isUpToDate)) { |
{ | ||
"name": "@electric-sql/client", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"description": "Postgres everywhere - your data, in sync, wherever you need it.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -22,2 +22,3 @@ import { | ||
LIVE_CACHE_BUSTER_QUERY_PARAM, | ||
COLUMNS_QUERY_PARAM, | ||
LIVE_QUERY_PARAM, | ||
@@ -41,6 +42,13 @@ OFFSET_QUERY_PARAM, | ||
/** | ||
* where clauses for the shape. | ||
* The where clauses for the shape. | ||
*/ | ||
where?: string | ||
/** | ||
* The columns to include in the shape. | ||
* Must include primary keys, and can only inlude valid columns. | ||
*/ | ||
columns?: string[] | ||
/** | ||
* The "offset" on the shape log. This is typically not set as the ShapeStream | ||
@@ -193,3 +201,3 @@ * will handle this automatically. A common scenario where you might pass an offset | ||
const { url, where, signal } = this.options | ||
const { url, where, columns, signal } = this.options | ||
@@ -203,2 +211,4 @@ try { | ||
if (where) fetchUrl.searchParams.set(WHERE_QUERY_PARAM, where) | ||
if (columns && columns.length > 0) | ||
fetchUrl.searchParams.set(COLUMNS_QUERY_PARAM, columns.join(`,`)) | ||
fetchUrl.searchParams.set(OFFSET_QUERY_PARAM, this.#lastOffset) | ||
@@ -205,0 +215,0 @@ |
@@ -10,2 +10,3 @@ export const SHAPE_ID_HEADER = `electric-shape-id` | ||
export const WHERE_QUERY_PARAM = `where` | ||
export const COLUMNS_QUERY_PARAM = `columns` | ||
export const LIVE_QUERY_PARAM = `live` |
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
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
Sorry, the diff of this file is not supported yet
363811
3810