Repository navigation
Implement support for binary replication - #4064
Conversation
9ca0d57 to
1df042e
Compare
vonzshik
left a comment
There was a problem hiding this comment.
Haven't got to the interesting stuff yet (will do later today), but here's something to get things going.
IIRC, at least in PostgreSQL logical replication you have to create the target tables before starting replication so the gold standard knows about specific schemas of tables. OTOH I don't see why knowing about table schemas would invalidate your argument.
Yes. It is sent before a relation message if the relation contains a custom type like a domain or an enum.
Personally I'd make them consistently private. |
Sure, but I'm thinking about a generic utility that you point at an arbitrary PG database, and it uses replication to e.g. write audit data in some format, or transfer changes to some other database in some way. In this category of scenarios, the replication client is not the application creating and using the tables (that's another user application), and so generally doesn't know anything about them beforehand.
Yeah, it doesn't really invalidate it, but... If I'm writing a replication client specifically for my application (the opposite of the above), and I know my schema because I'm coding against it, then I also know if it's safe to buffer entire rows (i.e. are they big or not). That kind of client would benefit from the usability of buffering, e.g. they could interact with replication rows just like they do with DbDataReader when sending a query (using column names in random order). So I do think there's some usability value for this category of scenarios, but it still doesn't make sense to me to provide buffering for them (for the reasons above).
Ahhh ok, thanks. I opened #4066 with some thoughts and possible further work here.
I guess you're right - I'll do that. |
One thing is that people may want to mock the replication API to test their clients, and we may be making that hard/impossible. But let's worry about that when people ask for it. |
Brar
left a comment
There was a problem hiding this comment.
IMO this is a pretty clean and focused API that also polishes some rough edges we had in 5.0.
Despite my two minor comments my only problem is, that it is incomplete with respect to custom types (see #4066).
You can probably temporarily copy and adapt the (overly complicated for long term purposes) tests from #4024 to test for completeness.
One thing we also should have some test coverage for, before we consider the API as ready, is custom type handlers and -mappings.
In this context we may also want to think about global and per connection handlers/mappings.
099a204 to
fca2a36
Compare
Closes npgsql#4049 Closes npgsql#4051 Closes npgsql#4068 Co-authored-by: Shay Rojansky <[email protected]>
fca2a36 to
287cf13
Compare
Closes #4049 Closes #4051 Closes #4068 Co-authored-by: Brar Piening <[email protected]>
Summary
IAsyncEnumerable<ReplicationValue>, whereReplicationValueprovides access to a specific column.Open/later questions
GetValues(object[])on it (possibly also an overload forstring[]). This could help for simpler scenarios; but it's also trivial for users to just enumerate externally and do it themselves... Maybe let's leave it for later.Closes #4049
Closes #4068
Closes #4051
Continues work from #4024