github electric-sql/electric @electric-sql/react@0.6.0

latest releases: @electric-sql/experimental@1.0.10, @electric-sql/y-electric@0.1.7, @core/sync-service@1.1.10...
9 months ago

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

    1. Created a new PostgresParams type to define PostgreSQL-specific parameters:
      • table: The root table for the shape
      • where: Where clauses for the shape
      • columns: Columns to include in the shape
      • replica: Whether to send full or partial row updates
    2. Moved PostgreSQL-specific options from the top-level ShapeStreamOptions interface to the params sub-key
    3. Updated ParamsRecord type to include PostgreSQL parameters
    4. Updated the ShapeStream class to handle parameters from the params object
    5. 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',
      },
    })

Patch Changes

  • Updated dependencies [9c50e8f]
  • Updated dependencies [af0c0bf]
  • Updated dependencies [e96928e]
    • @electric-sql/client@0.9.0

Don't miss a new electric release

NewReleases is sending notifications on new releases.