·
198 commits
to main
since this release
Minor Changes
-
e96928e: [BREAKING]: Move non-protocol options like table & where to the params sub-key
Context
Electric's TypeScript client is currently tightly coupled to PostgreSQL-specific options in its
ShapeStreamOptions
interface. As Electric plans to support multiple data sources in the future, we need to separate protocol-level options from source-specific options.Changes
- Created a new
PostgresParams
type to define PostgreSQL-specific parameters:table
: The root table for the shapewhere
: Where clauses for the shapecolumns
: Columns to include in the shapereplica
: Whether to send full or partial row updates
- Moved PostgreSQL-specific options from the top-level
ShapeStreamOptions
interface to theparams
sub-key - Updated
ParamsRecord
type to include PostgreSQL parameters - Updated the
ShapeStream
class to handle parameters from theparams
object - Updated documentation to reflect the changes
Migration Example
Before:
const stream = new ShapeStream({ url: 'http://localhost:3000/v1/shape', table: 'users', where: 'id > 100', columns: ['id', 'name'], replica: 'full', })
After:
const stream = new ShapeStream({ url: 'http://localhost:3000/v1/shape', params: { table: 'users', where: 'id > 100', columns: ['id', 'name'], replica: 'full', }, })
- Created a new
Patch Changes
- Updated dependencies [9c50e8f]
- Updated dependencies [af0c0bf]
- Updated dependencies [e96928e]
- @electric-sql/[email protected]