Skip to content

Commit

Permalink
rgw/sfs: update sqlite_orm to v1.8.2
Browse files Browse the repository at this point in the history
sqlite_orm v1.8.2 has fnc12/sqlite_orm#1054,
which I need for thread safety.  Unfortunately it's missing
fnc12/sqlite_orm#1169, without which
storage.sync_schema() breaks (or at least gives us nasty errors)
due to incorrect quotes.  In order to pick up the latter, I've
forked sqlite_orm into the aquarist-labs org, and made a branch
"v1.8.2-s3gw", which is upstream v1.8.2 plus a cherry pick of that
additional fix.

Signed-off-by: Tim Serong <[email protected]>
  • Loading branch information
tserong committed Oct 13, 2023
1 parent 2567cee commit b40e95b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@
url = https://github.com/open-telemetry/opentelemetry-cpp.git
[submodule "src/rgw/driver/sfs/sqlite/sqlite_orm"]
path = src/rgw/driver/sfs/sqlite/sqlite_orm
url = https://github.com/fnc12/sqlite_orm.git
url = https://github.com/aquarist-labs/sqlite_orm.git
14 changes: 6 additions & 8 deletions src/rgw/driver/sfs/sqlite/dbconn.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ inline auto _make_storage(const std::string& path) {
sqlite_orm::make_table(
std::string(VERSIONED_OBJECTS_TABLE),
sqlite_orm::make_column(
"id", &DBVersionedObject::id, sqlite_orm::autoincrement(),
sqlite_orm::primary_key()
"id", &DBVersionedObject::id,
sqlite_orm::primary_key().autoincrement()
),
sqlite_orm::make_column("object_id", &DBVersionedObject::object_id),
sqlite_orm::make_column("checksum", &DBVersionedObject::checksum),
Expand Down Expand Up @@ -182,8 +182,7 @@ inline auto _make_storage(const std::string& path) {
sqlite_orm::make_table(
std::string(ACCESS_KEYS),
sqlite_orm::make_column(
"id", &DBAccessKey::id, sqlite_orm::autoincrement(),
sqlite_orm::primary_key()
"id", &DBAccessKey::id, sqlite_orm::primary_key().autoincrement()
),
sqlite_orm::make_column("access_key", &DBAccessKey::access_key),
sqlite_orm::make_column("user_id", &DBAccessKey::user_id),
Expand Down Expand Up @@ -211,8 +210,7 @@ inline auto _make_storage(const std::string& path) {
sqlite_orm::make_table(
std::string(MULTIPARTS_TABLE),
sqlite_orm::make_column(
"id", &DBMultipart::id, sqlite_orm::primary_key(),
sqlite_orm::autoincrement()
"id", &DBMultipart::id, sqlite_orm::primary_key().autoincrement()
),
sqlite_orm::make_column("bucket_id", &DBMultipart::bucket_id),
sqlite_orm::make_column("upload_id", &DBMultipart::upload_id),
Expand All @@ -236,8 +234,8 @@ inline auto _make_storage(const std::string& path) {
sqlite_orm::make_table(
std::string(MULTIPARTS_PARTS_TABLE),
sqlite_orm::make_column(
"id", &DBMultipartPart::id, sqlite_orm::primary_key(),
sqlite_orm::autoincrement()
"id", &DBMultipartPart::id,
sqlite_orm::primary_key().autoincrement()
),
sqlite_orm::make_column("upload_id", &DBMultipartPart::upload_id),
sqlite_orm::make_column("part_num", &DBMultipartPart::part_num),
Expand Down
10 changes: 5 additions & 5 deletions src/rgw/driver/sfs/sqlite/sqlite_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ bool SQLiteList::objects(
greater_than(&DBObject::name, start_after_object_name) and
prefix_to_like(&DBObject::name, prefix)
),
group_by(&DBVersionedObject::object_id),
having(is_equal(
sqlite_orm::max(&DBVersionedObject::version_type),
VersionType::REGULAR
)),
group_by(&DBVersionedObject::object_id)
.having(is_equal(
sqlite_orm::max(&DBVersionedObject::version_type),
VersionType::REGULAR
)),
order_by(&DBObject::name), limit(query_limit)
);
ceph_assert(rows.size() <= static_cast<size_t>(query_limit));
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/driver/sfs/sqlite/sqlite_orm
Submodule sqlite_orm updated 317 files

0 comments on commit b40e95b

Please sign in to comment.