Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.

Commit

Permalink
sqlpp: include order issue fixed upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
th0br0 committed Apr 19, 2018
1 parent c409a4e commit 3fcda59
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Expand Up @@ -97,7 +97,7 @@ RawStringFormats:
Language: TextProto
BasedOnStyle: google
ReflowComments: true
SortIncludes: false
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
Expand Down
98 changes: 64 additions & 34 deletions WORKSPACE
@@ -1,57 +1,87 @@
workspace(name="org_iota_hub")

git_repository(name="org_pubref_rules_protobuf",
remote="https://github.com/pubref/rules_protobuf",
tag="v0.8.2")
git_repository(name="com_github_gflags_gflags",
commit="e292e0452fcfd5a8ae055b59052fc041cbab4abf",
remote="https://github.com/gflags/gflags.git")
git_repository(name="com_github_google_glog",
commit="2f493d292c92abf16ebd46cfd0cc0bf8eef5724d",
remote="https://github.com/google/glog.git")
git_repository(name="com_google_googletest",
commit="fdb57f85710ccb17076acb1870a881964f5e04af",
remote="https://github.com/google/googletest.git")

new_git_repository(name="hinnant_date",
remote="https://github.com/HowardHinnant/date.git",
commit="e5c69d84ab5db3e06170b8eedec1d87841c7fb22",
build_file="BUILD.date")

new_git_repository(name="sqlpp11",
remote="https://github.com/rbock/sqlpp11.git",
commit="1b12fddb7a0fa23f9abd07bef86a7ad010568573",
build_file="BUILD.sqlpp11")
# Global config

# EXTERNAL RULES
git_repository(
name="org_pubref_rules_protobuf",
remote="https://github.com/pubref/rules_protobuf",
tag="v0.8.2")
http_archive(
name="io_bazel_rules_go",
url=
"https://github.com/bazelbuild/rules_go/releases/download/0.11.0/rules_go-0.11.0.tar.gz",
sha256="f70c35a8c779bb92f7521ecb5a1c6604e9c3edd431e50b6376d7497abc8ad3c1",
)
git_repository(
name="com_github_nelhage_rules_boost",
commit="69e96e724cbe746f63d993fa8f6bf772e1ebc5cc",
remote="https://github.com/nelhage/rules_boost", )

# DEPENDENCIES
git_repository(
name="com_github_gflags_gflags",
commit="e292e0452fcfd5a8ae055b59052fc041cbab4abf",
remote="https://github.com/gflags/gflags.git")
git_repository(
name="com_github_google_glog",
commit="2f493d292c92abf16ebd46cfd0cc0bf8eef5724d",
remote="https://github.com/google/glog.git")
git_repository(
name="com_google_googletest",
commit="fdb57f85710ccb17076acb1870a881964f5e04af",
remote="https://github.com/google/googletest.git")

new_git_repository(
name="hinnant_date",
remote="https://github.com/HowardHinnant/date.git",
commit="e5c69d84ab5db3e06170b8eedec1d87841c7fb22",
build_file="BUILD.date")

new_git_repository(
name="sqlpp11",
remote="https://github.com/rbock/sqlpp11.git",
commit="9d64a5c7411f84cad1da71b23118634b5a62a063",
build_file="BUILD.sqlpp11")

new_git_repository(
name="sqlpp11sqlite",
remote="https://github.com/rbock/sqlpp11-connector-sqlite3.git",
commit="8d4ea283fa891c3f1eb7e45d012bdd4c0838e13a",
build_file="BUILD.sqlpp11sqlite")

git_repository(name="com_github_nelhage_rules_boost",
commit="69e96e724cbe746f63d993fa8f6bf772e1ebc5cc",
remote="https://github.com/nelhage/rules_boost", )

new_http_archive(
name="libsodium",
url="https://github.com/jedisct1/libsodium/archive/1.0.16.tar.gz",
strip_prefix="libsodium-1.0.16",
sha256="0c14604bbeab2e82a803215d65c3b6e74bb28291aaee6236d65c699ccfe1a98c",
build_file="BUILD.libsodium")

new_git_repository(name="azmq",
remote="https://github.com/zeromq/azmq.git",
commit="a8f54cc8c9672da7d6301fe1d2719b1436ab4816",
build_file="BUILD.azmq")
new_git_repository(
name="azmq",
remote="https://github.com/zeromq/azmq.git",
commit="a8f54cc8c9672da7d6301fe1d2719b1436ab4816",
build_file="BUILD.azmq")

new_git_repository(name="libzmq",
remote="https://github.com/zeromq/libzmq.git",
tag="v4.2.5",
build_file="BUILD.libzmq", )
new_git_repository(
name="libzmq",
remote="https://github.com/zeromq/libzmq.git",
tag="v4.2.5",
build_file="BUILD.libzmq", )

load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
boost_deps()

load("@org_pubref_rules_protobuf//cpp:rules.bzl", "cpp_proto_repositories")
cpp_proto_repositories()

load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies",
"go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()

load("@org_pubref_rules_protobuf//go:rules.bzl", "go_proto_repositories")
go_proto_repositories()
load("@org_pubref_rules_protobuf//grpc_gateway:rules.bzl",
"grpc_gateway_proto_repositories")
grpc_gateway_proto_repositories()
7 changes: 4 additions & 3 deletions hub/commands/create_user.cc
Expand Up @@ -16,8 +16,9 @@ using namespace sqlpp;
namespace iota {
namespace cmd {

grpc::Status CreateUser::doProcess(const iota::rpc::CreateUserRequest* request,
iota::rpc::CreateUserReply* response) noexcept {
grpc::Status CreateUser::doProcess(
const iota::rpc::CreateUserRequest* request,
iota::rpc::CreateUserReply* response) noexcept {
db::sql::UserAccount userAccount;

auto& connection = db::DBManager::get().connection();
Expand All @@ -26,7 +27,7 @@ grpc::Status CreateUser::doProcess(const iota::rpc::CreateUserRequest* request,

try {
connection(insert_into(userAccount)
.set(userAccount.identifier = request->userid()));
.set(userAccount.identifier = request->userid()));
transaction.commit();
} catch (sqlpp::exception& ex) {
LOG(ERROR) << session() << " Commit failed: " << ex.what();
Expand Down
5 changes: 3 additions & 2 deletions hub/commands/create_user.h
Expand Up @@ -17,8 +17,9 @@ class CreateUser
using Command<iota::rpc::CreateUserRequest,
iota::rpc::CreateUserReply>::Command;

grpc::Status doProcess(const iota::rpc::CreateUserRequest* request,
iota::rpc::CreateUserReply* response) noexcept override;
grpc::Status doProcess(
const iota::rpc::CreateUserRequest* request,
iota::rpc::CreateUserReply* response) noexcept override;

const std::string name() override { return "CreateUser"; }
};
Expand Down
6 changes: 3 additions & 3 deletions hub/commands/get_balance.cc
Expand Up @@ -3,13 +3,13 @@
#include <cstdint>

#include <sqlpp11/connection.h>
#include <sqlpp11/select.h>
#include <sqlpp11/functions.h>
#include <sqlpp11/select.h>

#include "proto/hub.pb.h"
#include "schema/schema.h"
#include "hub/db/db.h"
#include "hub/stats/session.h"
#include "proto/hub.pb.h"
#include "schema/schema.h"

#include "helper.h"

Expand Down
5 changes: 3 additions & 2 deletions hub/commands/get_balance.h
Expand Up @@ -17,8 +17,9 @@ class GetBalance
using Command<iota::rpc::GetBalanceRequest,
iota::rpc::GetBalanceReply>::Command;

grpc::Status doProcess(const iota::rpc::GetBalanceRequest* request,
iota::rpc::GetBalanceReply* response) noexcept override;
grpc::Status doProcess(
const iota::rpc::GetBalanceRequest* request,
iota::rpc::GetBalanceReply* response) noexcept override;

const std::string name() override { return "GetBalance"; }
};
Expand Down
16 changes: 8 additions & 8 deletions hub/commands/helper.cc
Expand Up @@ -6,14 +6,14 @@

namespace iota {
namespace cmd {
std::string errorToString(const iota::rpc::ErrorCode& e) {
std::ostringstream ss;
iota::rpc::Error error;
std::string errorToString(const iota::rpc::ErrorCode& e) {
std::ostringstream ss;
iota::rpc::Error error;

error.set_code(e);
error.SerializeToOstream(&ss);

return ss.str();
}
error.set_code(e);
error.SerializeToOstream(&ss);

return ss.str();
}
} // namespace cmd
} // namespace iota
2 changes: 1 addition & 1 deletion hub/commands/tests/test_create_user.cc
@@ -1,7 +1,7 @@
#include <gtest/gtest.h>

#include <sqlpp11/select.h>
#include <sqlpp11/functions.h>
#include <sqlpp11/select.h>

#include "proto/hub.pb.h"
#include "schema/schema.h"
Expand Down
4 changes: 2 additions & 2 deletions hub/commands/tests/test_get_balance.cc
@@ -1,13 +1,13 @@
#include <gtest/gtest.h>
#include <sqlpp11/select.h>
#include <sqlpp11/functions.h>
#include <sqlpp11/select.h>

#include "proto/hub.pb.h"
#include "schema/schema.h"

#include "hub/commands/get_balance.h"
#include "hub/db/db.h"
#include "hub/stats/session.h"
#include "hub/commands/get_balance.h"

#include "runner.h"

Expand Down

0 comments on commit 3fcda59

Please sign in to comment.