Skip to content

db: connection pool - #24161

Merged
medvednikov merged 1 commit into
vlang:masterfrom
enghitalo:db/pool
Apr 10, 2025
Merged

medvednikov merged 1 commit into
vlang:masterfrom
enghitalo:db/pool

Conversation

@enghitalo

Copy link
Copy Markdown
Contributor

Thread-safe database pool

@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-22550

@Jengro777

Copy link
Copy Markdown
Contributor

#23995

@Delta456 Delta456 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to have a common ConnectionPool implementation across all DBs?

@enghitalo

Copy link
Copy Markdown
Contributor Author

Is there a way to have a common ConnectionPool implementation across all DBs?

Yes. Just pass the DB and Config as generic. I'll do that.

@Delta456

Delta456 commented Apr 8, 2025

Copy link
Copy Markdown
Member

Let's do that in this PR itself

@enghitalo

Copy link
Copy Markdown
Contributor Author

I'm going to my English class now, possibly I'll only be able to do it when I leave class

@Jengro777

Copy link
Copy Markdown
Contributor

#23995

I think we should implement a connection pool for MySQL, PostgreSQL, and SQLite, just like the go language's database/sql.

@Jengro777

Copy link
Copy Markdown
Contributor

At least achieve it.

  1. Minimum number of connections
  2. Maximum number of connections
  3. Maximum timeout

@Jengro777

Copy link
Copy Markdown
Contributor

I think you can create the db / pool module directly within the db module for a more general database connection pool

@enghitalo enghitalo closed this Apr 8, 2025
@Jengro777

Copy link
Copy Markdown
Contributor

How did it shut down? is it going to continue? I'm looking forward to it.

@enghitalo

Copy link
Copy Markdown
Contributor Author

How did it shut down? is it going to continue? I'm looking forward to it.

@Avey777 Alex is interested in it. unfortunately, I will not have enough time to work in it. But this is ready to merge. It will probably be merged as soon as possible.

@enghitalo

Copy link
Copy Markdown
Contributor Author

At least achieve it.

  1. Minimum number of connections
    R: I don't really see why.
  2. Maximum number of connections
    R: The channel already guarantees that it has a maximum limit.
  3. Maximum timeout
    R: I agree. Possibly in the future as an improvement

@Jengro777

Copy link
Copy Markdown
Contributor

At least achieve it.

  1. Minimum number of connections
    R: I don't really see why.
  2. Maximum number of connections
    R: The channel already guarantees that it has a maximum limit.
  3. Maximum timeout
    R: I agree. Possibly in the future as an improvement

Minimum number of connections guarantees the fastest response rate for new requests coming in! You can also set it to 0.

@medvednikov medvednikov reopened this Apr 9, 2025
@Jengro777

Copy link
Copy Markdown
Contributor

#23995

The database / pool of go language is worth a reference

@medvednikov
medvednikov merged commit bab3f23 into vlang:master Apr 10, 2025
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.

4 participants