sinisaos
sinisaos
@guruvignesh01 Not sure but I think this should work ([docs](https://piccolo-orm.readthedocs.io/en/latest/piccolo/engines/postgres_engine.html#source)) because you can pass `node` argument to [run() method](https://github.com/piccolo-orm/piccolo/blob/master/piccolo/query/base.py#L167). ```python async with await YourTable.select().batch(batch_size=100).run(node="your_read_replica") as batch: async for _batch in...
@guruvignesh01 @dantownsend Sorry for the wrong answer. I didn't know that.
@dantownsend No problem, I can try.
@dantownsend Fix for Piccolo Api and Piccolo Admin is [here](https://github.com/piccolo-orm/piccolo_api/pull/134)
@dantownsend Will this be enough? ```python from piccolo.utils.sync import run_sync # Make sure the node is queried in batch run_sync(Manager.select().batch(node="read_1")) self.assertTrue(EXTRA_NODE.run_querystring.called) ``` Tests pass with it.
I'm pass a test database in `test_batch.py` as a `read_replica` to be able to test if batch method node argument is called. Locally all tests passed but failed on Sqlite...
@dantownsend I was finally able to pass all the tests in GH actions by importing the test database instance into the local namespace of the test method. Can you check...
@dantownsend Your approach is much better, and everything looks good. Thanks.
@dantownsend I've never used CockroachDB and I don't know if this is relevant but I managed to connect to the database with `PostgresEngine` like this ```python DB = PostgresEngine( config={...
> How easy did you find it to install CockroachDB locally? Local installation is quite simple ([linux](https://www.cockroachlabs.com/docs/v21.2/install-cockroachdb-linux), [mac](https://www.cockroachlabs.com/docs/v21.2/install-cockroachdb-mac)). For my attempt, I launched an [insecure cluster](https://www.cockroachlabs.com/docs/v21.2/start-a-local-cluster), but a [secure cluster](https://www.cockroachlabs.com/docs/v21.2/secure-a-cluster)...