Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sequelize query option from a kysely query #154

Open
ianjkaplan opened this issue Sep 14, 2024 · 0 comments
Open

Support sequelize query option from a kysely query #154

ianjkaplan opened this issue Sep 14, 2024 · 0 comments

Comments

@ianjkaplan
Copy link

ianjkaplan commented Sep 14, 2024

In a replicated configuration, sequelize supports overriding the default behavior where reads go to a replica and writes go to the primary.
https://sequelize.org/docs/v6/other-topics/read-replication/

This behavior is supported through the QueryOptions type. https://sequelize.org/api/v7/interfaces/_sequelize_core.index.queryoptions
It looks like the sequelize query options are not exposed to the caller when executing a kysely query.

To account for replication lag in "read-after-write" scenarios in kysely, I wonder if there is a way to expose something similar to the useMaster option in a kysely query to the underlying sequelize instance. This would help migrate code from Sequelize to kysely while preserving its current behavior.

Is this feasible, Im interested to hear thoughts on an approach as i look into it myself. If so I can contribute to the implementation. Please advice at your convenience.

Thanks in advance!

@ianjkaplan ianjkaplan changed the title Support primary database reads Support primary database reads from a Kysely query Sep 14, 2024
@ianjkaplan ianjkaplan changed the title Support primary database reads from a Kysely query Support primary database reads from a kysely query in a replicated configuration Sep 14, 2024
@ianjkaplan ianjkaplan changed the title Support primary database reads from a kysely query in a replicated configuration Support sequelize query option from a kysely query Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant