mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-03 17:35:51 +00:00
Use beast_sqlite and beast_sqdb
This commit is contained in:
@@ -63,6 +63,8 @@ SOURCES += \
|
||||
../../Subtrees/beast/modules/beast_core/beast_core.cpp \
|
||||
../../Subtrees/beast/modules/beast_crypto/beast_crypto.cpp \
|
||||
../../Subtrees/beast/modules/beast_db/beast_db.cpp \
|
||||
../../Subtrees/beast/modules/beast_sqdb/beast_sqdb.cpp \
|
||||
../../Subtrees/beast/modules/beast_sqlite/beast_sqlite.cpp \
|
||||
../../modules/ripple_app/ripple_app_pt1.cpp \
|
||||
../../modules/ripple_app/ripple_app_pt2.cpp \
|
||||
../../modules/ripple_app/ripple_app_pt3.cpp \
|
||||
@@ -81,7 +83,6 @@ SOURCES += \
|
||||
../../modules/ripple_leveldb/ripple_leveldb.cpp \
|
||||
../../modules/ripple_mdb/ripple_mdb.c \
|
||||
../../modules/ripple_net/ripple_net.cpp \
|
||||
../../modules/ripple_sqlite/ripple_sqlite.c \
|
||||
../../modules/ripple_websocket/ripple_websocket.cpp
|
||||
|
||||
LIBS += \
|
||||
|
||||
@@ -1019,7 +1019,12 @@
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\ripple_net\ripple_net.cpp" />
|
||||
<ClCompile Include="..\..\modules\ripple_sqlite\ripple_sqlite.c" />
|
||||
<ClCompile Include="..\..\modules\ripple_sqlite\ripple_sqlite.c">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\modules\ripple_websocket\autosocket\ripple_AutoSocket.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -1038,6 +1043,8 @@
|
||||
<ClCompile Include="..\..\Subtrees\beast\modules\beast_core\beast_core.cpp" />
|
||||
<ClCompile Include="..\..\Subtrees\beast\modules\beast_crypto\beast_crypto.cpp" />
|
||||
<ClCompile Include="..\..\Subtrees\beast\modules\beast_db\beast_db.cpp" />
|
||||
<ClCompile Include="..\..\Subtrees\beast\modules\beast_sqdb\beast_sqdb.cpp" />
|
||||
<ClCompile Include="..\..\Subtrees\beast\modules\beast_sqlite\beast_sqlite.c" />
|
||||
<ClCompile Include="..\..\Subtrees\leveldb\db\builder.cc">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
|
||||
@@ -906,6 +906,12 @@
|
||||
<ClCompile Include="..\..\modules\ripple_app\tx\WalletAddTransactor.cpp">
|
||||
<Filter>[1] Ripple\ripple_app\tx</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Subtrees\beast\modules\beast_sqdb\beast_sqdb.cpp">
|
||||
<Filter>[0] Subtrees\beast</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Subtrees\beast\modules\beast_sqlite\beast_sqlite.c">
|
||||
<Filter>[0] Subtrees\beast</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\Subtrees\sqlite\sqlite3.h">
|
||||
|
||||
@@ -141,8 +141,7 @@ COMPILED_FILES = [
|
||||
'modules/ripple_leveldb/ripple_leveldb.cpp',
|
||||
'modules/ripple_mdb/ripple_mdb.c',
|
||||
'modules/ripple_net/ripple_net.cpp',
|
||||
'modules/ripple_websocket/ripple_websocket.cpp',
|
||||
'modules/ripple_sqlite/ripple_sqlite.c'
|
||||
'modules/ripple_websocket/ripple_websocket.cpp'
|
||||
]
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
@@ -57,11 +57,6 @@
|
||||
*/
|
||||
//#define SQLITE_THREADSAFE 2
|
||||
|
||||
/* When compiled with SQLITE_THREADSAFE=2, SQLite can be used in a
|
||||
multithreaded program so long as no two threads attempt to use the
|
||||
same database connection at the same time.
|
||||
*/
|
||||
|
||||
#include "sqlite/sqlite3.c"
|
||||
|
||||
#if BEAST_MSVC
|
||||
|
||||
@@ -61,11 +61,13 @@
|
||||
#include <boost/unordered_set.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
|
||||
#include "../ripple_sqlite/ripple_sqlite.h" // for SqliteDatabase.cpp
|
||||
//#include "../ripple_sqlite/ripple_sqlite.h" // for SqliteDatabase.cpp
|
||||
|
||||
#include "../ripple_core/ripple_core.h"
|
||||
|
||||
#include "beast/modules/beast_db/beast_db.h"
|
||||
#include "beast/modules/beast_sqdb/beast_sqdb.h"
|
||||
#include "beast/modules/beast_sqlite/beast_sqlite.h"
|
||||
|
||||
// VFALCO TODO fix these warnings!
|
||||
#ifdef _MSC_VER
|
||||
|
||||
@@ -135,8 +135,6 @@ StringPairArray parseKeyValueSection (Section& secSource, String const& strSecti
|
||||
// yuck.
|
||||
std::string const stdStrSection (strSection.toStdString ());
|
||||
|
||||
int const count = SectionCount (secSource, stdStrSection);
|
||||
|
||||
typedef Section::mapped_type Entries;
|
||||
|
||||
Entries* const entries = SectionEntries (secSource, stdStrSection);
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (c) 2011-2013, OpenCoin, Inc.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
/** Add this to get the @ref ripple_sqlite module.
|
||||
|
||||
@file ripple_sqlite.cpp
|
||||
@ingroup ripple_sqlite
|
||||
*/
|
||||
|
||||
#include "BeastConfig.h"
|
||||
|
||||
// This prevents sqlite.h from being included
|
||||
//
|
||||
#define RIPPLE_SQLITE_MODULE_INCLUDED 1
|
||||
|
||||
#include "ripple_sqlite.h"
|
||||
|
||||
#if BEAST_MSVC
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable: 4100) /* unreferenced formal parameter */
|
||||
#pragma warning (disable: 4127) /* conditional expression is constant */
|
||||
#pragma warning (disable: 4232) /* nonstandard extension used: dllimport address */
|
||||
#pragma warning (disable: 4244) /* conversion from 'int': possible loss of data */
|
||||
#pragma warning (disable: 4701) /* potentially uninitialized variable */
|
||||
#pragma warning (disable: 4706) /* assignment within conditional expression */
|
||||
#endif
|
||||
|
||||
/* When compiled with SQLITE_THREADSAFE=1, SQLite operates in serialized mode.
|
||||
In this mode, SQLite can be safely used by multiple threads with no restriction.
|
||||
|
||||
VFALCO NOTE This implies a global mutex!
|
||||
|
||||
NOTE Windows builds never had the threading model set. However, SQLite
|
||||
defaults to Serialized (SQLITE_THREADSAFE == 1). Does Ripple need
|
||||
Serialized mode? Because Ripple already uses a mutex with every
|
||||
instance of the sqlite database session object.
|
||||
*/
|
||||
#define SQLITE_THREADSAFE 1
|
||||
|
||||
/* When compiled with SQLITE_THREADSAFE=2, SQLite can be used in a
|
||||
multithreaded program so long as no two threads attempt to use the
|
||||
same database connection at the same time.
|
||||
|
||||
VFALCO NOTE This is the preferred threading model.
|
||||
|
||||
TODO Determine if Ripple can support this model.
|
||||
*/
|
||||
//#define SQLITE_THREADSAFE 2
|
||||
|
||||
// VFALCO TODO We should try running with SQLITE_THREADSAFE==2 and see what happens.
|
||||
#if SQLITE_THREADSAFE != 2
|
||||
//#pragma message(BEAST_FILEANDLINE_ "Possible performance issue, SQLITE_THREADSAFE != 2")
|
||||
#endif
|
||||
|
||||
#include "sqlite/sqlite3.c"
|
||||
|
||||
#if BEAST_MSVC
|
||||
#pragma warning (pop)
|
||||
#endif
|
||||
@@ -1,30 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (c) 2011-2013, OpenCoin, Inc.
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
/** Include this to get the @ref ripple_sqlite module.
|
||||
|
||||
@file ripple_sqlite.h
|
||||
@ingroup ripple_sqlite
|
||||
*/
|
||||
|
||||
/** Sqlite3 support.
|
||||
|
||||
This module brings in the Sqlite embedded database engine.
|
||||
|
||||
@defgroup ripple_sqlite
|
||||
*/
|
||||
|
||||
#ifndef RIPPLE_SQLITE_RIPPLEHEADER
|
||||
#define RIPPLE_SQLITE_RIPPLEHEADER
|
||||
|
||||
// Include this directly because we compile under both C and C++
|
||||
#include "beast/modules/beast_core/system/beast_TargetPlatform.h"
|
||||
|
||||
#if ! RIPPLE_SQLITE_MODULE_INCLUDED
|
||||
#include "sqlite/sqlite3.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user