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

feat(slonik): add support for custom sql factory class #742

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

opichon
Copy link
Contributor

@opichon opichon commented Sep 8, 2024

In slonik package, make it easier to customize the SqlFactory class in the Service.
Instead of having to rewrite the getFactory method, s Service class now only has to define its sqlFactoryClass property

import MySqlFactory from "...";

class MyService extends BaseService {
  ...
  get sqlFactoryClass() {
    return MySqlFactory;
  }

I have tested this minimally in the website-build package, and it needs to be tested much more thoroughly. In particular, please check other projects to see if they already define a custom SqlFactory class.

@rameshlohala
Copy link
Contributor

rameshlohala commented Sep 10, 2024

I have tested it in our app, working as expected.
Most of the model in different projects defined a custom SqlFactory (extending DefaultSqlFactory) rewriting getFactory method so this changes will not affect them. but devs can refactor the existing model services to adopt this as well as implement in new services.

@rameshlohala rameshlohala merged commit 4d63632 into main Sep 11, 2024
3 checks passed
@rameshlohala rameshlohala deleted the featslonik-sql-factory-class branch September 11, 2024 04:30
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

Successfully merging this pull request may close these issues.

2 participants