Skip to content

Commit

Permalink
Update generated protocol messages
Browse files Browse the repository at this point in the history
  • Loading branch information
alco committed Mar 14, 2024
1 parent f8bb88e commit da7bc9f
Show file tree
Hide file tree
Showing 3 changed files with 279 additions and 77 deletions.
33 changes: 32 additions & 1 deletion clients/typescript/src/_generated/protocol/satellite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,14 @@ export interface SatInStartReplicationReq {
/** the subscriptions identifiers the client wants to resume subscription */
subscriptionIds: string[];
/** The version of the most recent migration seen by the client. */
schemaVersion?: string | undefined;
schemaVersion?:
| string
| undefined;
/**
* The SQL dialect used by the client
* Defaults to SQLite if not specified
*/
sqlDialect?: SatInStartReplicationReq_Dialect | undefined;
}

export enum SatInStartReplicationReq_Option {
Expand All @@ -123,6 +130,12 @@ export enum SatInStartReplicationReq_Option {
UNRECOGNIZED = -1,
}

export enum SatInStartReplicationReq_Dialect {
SQLITE = 0,
POSTGRES = 1,
UNRECOGNIZED = -1,
}

/** (Producer) The result of the start replication requests */
export interface SatInStartReplicationResp {
$type: "Electric.Satellite.SatInStartReplicationResp";
Expand Down Expand Up @@ -383,9 +396,15 @@ export interface SatOpMigrate_PgColumnType {
size: number[];
}

/** reserved 2; */
export interface SatOpMigrate_Column {
$type: "Electric.Satellite.SatOpMigrate.Column";
name: string;
/**
* deprecated
* leaving it here to avoid breaking TypeScript tests that have hard-coded,
* base64-encoded SatOpMigrate messages.
*/
sqliteType: string;
pgType: SatOpMigrate_PgColumnType | undefined;
}
Expand Down Expand Up @@ -1015,6 +1034,7 @@ function createBaseSatInStartReplicationReq(): SatInStartReplicationReq {
options: [],
subscriptionIds: [],
schemaVersion: undefined,
sqlDialect: undefined,
};
}

Expand All @@ -1036,6 +1056,9 @@ export const SatInStartReplicationReq = {
if (message.schemaVersion !== undefined) {
writer.uint32(42).string(message.schemaVersion);
}
if (message.sqlDialect !== undefined) {
writer.uint32(48).int32(message.sqlDialect);
}
return writer;
},

Expand Down Expand Up @@ -1084,6 +1107,13 @@ export const SatInStartReplicationReq = {

message.schemaVersion = reader.string();
continue;
case 6:
if (tag !== 48) {
break;
}

message.sqlDialect = reader.int32() as any;
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
Expand All @@ -1103,6 +1133,7 @@ export const SatInStartReplicationReq = {
message.options = object.options?.map((e) => e) || [];
message.subscriptionIds = object.subscriptionIds?.map((e) => e) || [];
message.schemaVersion = object.schemaVersion ?? undefined;
message.sqlDialect = object.sqlDialect ?? undefined;
return message;
},
};
Expand Down
56 changes: 28 additions & 28 deletions components/electric/lib/electric/postgres/schema/proto/messages.ex
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{2, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
Expand Down Expand Up @@ -1201,7 +1201,7 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{2, 2, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
Expand Down Expand Up @@ -2399,7 +2399,7 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{2, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
Expand Down Expand Up @@ -3169,7 +3169,7 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{2, _, bytes} ->
{value, rest} = Protox.Decode.parse_bool(bytes)
Expand Down Expand Up @@ -3209,7 +3209,7 @@
{8, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[fk_cols: msg.fk_cols ++ [delimited]], rest}
{[fk_cols: msg.fk_cols ++ [Protox.Decode.validate_string(delimited)]], rest}

{9, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
Expand All @@ -3226,7 +3226,7 @@
{10, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[pk_cols: msg.pk_cols ++ [delimited]], rest}
{[pk_cols: msg.pk_cols ++ [Protox.Decode.validate_string(delimited)]], rest}

{tag, wire_type, rest} ->
{_, rest} = Protox.Decode.parse_unknown(tag, wire_type, rest)
Expand Down Expand Up @@ -3914,7 +3914,7 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{2, _, bytes} ->
{value, rest} =
Expand Down Expand Up @@ -4451,7 +4451,7 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{3, _, bytes} ->
{value, rest} = Protox.Decode.parse_bool(bytes)
Expand Down Expand Up @@ -4849,17 +4849,17 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{3, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[keys: msg.keys ++ [delimited]], rest}
{[keys: msg.keys ++ [Protox.Decode.validate_string(delimited)]], rest}

{4, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[including: msg.including ++ [delimited]], rest}
{[including: msg.including ++ [Protox.Decode.validate_string(delimited)]], rest}

{5, _, bytes} ->
{value, rest} = Protox.Decode.parse_bool(bytes)
Expand Down Expand Up @@ -5343,17 +5343,17 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{3, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[keys: msg.keys ++ [delimited]], rest}
{[keys: msg.keys ++ [Protox.Decode.validate_string(delimited)]], rest}

{4, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[including: msg.including ++ [delimited]], rest}
{[including: msg.including ++ [Protox.Decode.validate_string(delimited)]], rest}

{5, _, bytes} ->
{value, rest} = Protox.Decode.parse_bool(bytes)
Expand Down Expand Up @@ -5800,7 +5800,7 @@
{2, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[values: msg.values ++ [delimited]], rest}
{[values: msg.values ++ [Protox.Decode.validate_string(delimited)]], rest}

{tag, wire_type, rest} ->
{_, rest} = Protox.Decode.parse_unknown(tag, wire_type, rest)
Expand Down Expand Up @@ -7010,7 +7010,7 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{2, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
Expand Down Expand Up @@ -7984,7 +7984,7 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{tag, wire_type, rest} ->
{_, rest} = Protox.Decode.parse_unknown(tag, wire_type, rest)
Expand Down Expand Up @@ -8477,7 +8477,7 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{2, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
Expand Down Expand Up @@ -9168,7 +9168,7 @@
{2, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[value: delimited], rest}
{[value: Protox.Decode.validate_string(delimited)], rest}

{tag, wire_type, rest} ->
{_, rest} = Protox.Decode.parse_unknown(tag, wire_type, rest)
Expand Down Expand Up @@ -9472,7 +9472,7 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{2, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
Expand Down Expand Up @@ -9873,7 +9873,7 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{2, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
Expand Down Expand Up @@ -9904,7 +9904,7 @@
{5, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[including: msg.including ++ [delimited]], rest}
{[including: msg.including ++ [Protox.Decode.validate_string(delimited)]], rest}

{6, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
Expand All @@ -9921,7 +9921,7 @@
{7, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[using: delimited], rest}
{[using: Protox.Decode.validate_string(delimited)], rest}

{8, _, bytes} ->
{value, rest} = Protox.Decode.parse_int32(bytes)
Expand Down Expand Up @@ -10525,12 +10525,12 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{2, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[collation: delimited], rest}
{[collation: Protox.Decode.validate_string(delimited)], rest}

{3, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
Expand Down Expand Up @@ -11008,17 +11008,17 @@
{1, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[name: delimited], rest}
{[name: Protox.Decode.validate_string(delimited)], rest}

{2, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[schema: delimited], rest}
{[schema: Protox.Decode.validate_string(delimited)], rest}

{3, _, bytes} ->
{len, bytes} = Protox.Varint.decode(bytes)
{delimited, rest} = Protox.Decode.parse_delimited(bytes, len)
{[alias: delimited], rest}
{[alias: Protox.Decode.validate_string(delimited)], rest}

{tag, wire_type, rest} ->
{_, rest} = Protox.Decode.parse_unknown(tag, wire_type, rest)
Expand Down

0 comments on commit da7bc9f

Please sign in to comment.