Refactor query routing into its own module (#22)

* Refactor query routing into its own module

* commments; tests; dead code

* error message

* safer startup

* hm

* dont have to be public

* wow

* fix ci

* ok

* nl

* no more silent errors
This commit is contained in:
Lev Kokotov
2022-02-16 22:52:11 -08:00
committed by GitHub
parent 7b0ceefb96
commit 4c8a3987fe
11 changed files with 364 additions and 144 deletions

View File

@@ -1,3 +1,5 @@
\set ON_ERROR_STOP on
SET SERVER ROLE TO 'primary';
SET SHARDING KEY TO '1';
INSERT INTO data (id, value) VALUES (1, 'value_1');
@@ -88,6 +90,8 @@ SELECT * FROM data WHERE id = 9;
---
\set ON_ERROR_STOP on
SET SERVER ROLE TO 'primary';
SET SHARDING KEY TO '10';
INSERT INTO data (id, value) VALUES (10, 'value_1');
@@ -143,3 +147,7 @@ SELECT 1;
SET SERVER ROLE TO 'replica';
SELECT 1;
set server role to 'replica';
SeT SeRver Role TO 'PrImARY';
select 1;