Comments (2)
@dragarcia this could be a good first task for elixir tomorrow.
from realtime.
Solution
Now that we forked away from PGOutputDecoder, the following were implemented:
server/lib/decoder/oid_database.ex
- Update the mapping on
server/lib/decoder/oid_database.ex
to cover all base PgSQL data types. This is based on this - Change mapping function to parse through the comprehensive map instead of creating multiple functions to map to each data type. If the
data_type_id
is found, the corresponding data type name is provided. If not found, then the data type id is returned.
- Update the mapping on
server/lib/realtime/replication.ex
- We noticed that for unique data types, they are being broadcasted under the
Type
flag. We utilised this opportunity underprocess_message(%Type{} = msg, state)
to create a mapping of unique data type IDs and their corresponding data type name. - Under
process_message(%Relation{} = msg, state)
, we take the list of columns processed by the function mentioned above byoid_database.ex
and go through each column. - If the type of the column is found as a key in the mapping of unique data type IDs and its names, then we update the type to be the corresponding name of the data type id.
- This now ensures that all data types are properly identified and labeled before reaching the client.
- We noticed that for unique data types, they are being broadcasted under the
How I tested
- Run monorepo without realtime
- Run a local version of realtime, ensuring that the database connection is pointed to the database in monorepo
- Run HQ locally and start making changes
- Observe the logs on the local version of realtime.
- I left a log to show that all columns have been labeled properly
- This is ran in the very last
process_message
function that is ran before being sent to the client which is:
process_message(
%Commit{lsn: commit_lsn, end_lsn: end_lsn},
%State{transaction: {current_txn_lsn, _txn}} = state
)
from realtime.
Related Issues (20)
- Realtime version and release don't match HOT 1
- log_min_messages requires elevated privileges HOT 1
- Docker hub `latest` image tag is very old HOT 3
- What version of realtime is hosted Supabase using? HOT 1
- Add region to all Logger metadatas
- Realtime: Self Hosting - Docker Swarm mode HOT 6
- Docker-compose file appears to be broken HOT 40
- Unable to use null filters like 'parent IS NULL' in supabase realtime. HOT 3
- How is postgres binary data serialized?
- > Does supabase have null filters? HOT 1
- Self hosted : failed to connect: ** (Postgrex.Error) ssl not available HOT 1
- Startup error running migrations: table identifier does not refer to an existing ETS table HOT 8
- Erroneous public.test_tenant file from Supabase Realtime Migrations HOT 5
- Supabase Realtime Subscript Fails With Undefined Error (Possibly: `Auth error: tenant 'realtime-dev' not found` HOT 15
- supabase realtime not working HOT 26
- Seeds broken in latest docker image HOT 2
- horizontal scaling for self-hosted realtime servers, for broadcast and presence features HOT 5
- HTTP 431 & Realtime Subscriptions Failing HOT 11
- Realtime event broadcasting through REST calls does not work HOT 8
- Excessive logs being printed to STD OUT/ERR HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from realtime.