Skip to content
代码片段 群组 项目
未验证 提交 9bb48c9b 编辑于 作者: Yorick Peterse's avatar Yorick Peterse
浏览文件

Split Database::Connection into separate types

Gitlab::Database::Connection was a kitchen sink type of class: it had
methods for obtaining database information (e.g. the database name),
running WAL related queries, querying the status of transactions, and
more.

This commit splits this class into separate types. For example,
reflection related methods are now located in
Gitlab::Database::Reflection. Transaction related methods are moved into
the Transactions module. The method to get a WAL diff has been moved
into the LoadBalancer class.

With this also changes the use of these methods. For example, instead of
this:

    Gitlab::Database.main.cached_column_exists?(:users, :id)

You now write this:

    Users.database.cached_column_exists?(:id)

Apart from being shorter in many cases, it also decouples the code using
these methods from the main database. This makes it easier to support
multiple databases over time.
上级 2edef5d4
No related branches found
No related tags found
无相关合并请求
显示
134 个添加29 个删除
加载中
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册