10 #ifndef DBMAIN_DATABASE_H
11 #define DBMAIN_DATABASE_H
93 void open(
const std::string& path,
size_t bpool_size,
bool create,
94 bool allow_overwrite =
false);
134 std::vector<Oid> coltypid,
135 std::vector<uint64_t> coltypparam = {},
136 const std::vector<absl::string_view> &field_names = {},
137 std::vector<bool> colisnullable = {},
138 std::vector<bool> colisarray = {});
154 std::vector<FieldId> idxcoltabcolids,
155 std::vector<Oid> idxcolltfuncids = {},
156 std::vector<Oid> idxcoleqfuncids = {});
176 #define g_bufman g_db->buf_manager()
179 #define g_fileman g_db->file_manager()
182 #define g_catcache g_db->catcache()
185 #define g_actsch g_db->actres_schema()
BufferManager implements a steal and no-force buffer pool with a fixed number of page frames to buffe...
Definition: BufferManager.h:77
Catcache is the catalog cache class as configured in the top-level CMakeLists.txt.
Definition: CatCache.h:18
The class for a database instance.
Definition: Database.h:65
std::string m_db_path
Definition: Database.h:165
constexpr bool is_open() const
Definition: Database.h:97
BufferManager * buf_manager() const
Definition: Database.h:113
Schema * actres_schema() const
Definition: Database.cpp:104
FileManager * m_file_manager
Definition: Database.h:166
Schema * m_actres_schema
Definition: Database.h:169
bool m_initialized
Definition: Database.h:164
~Database()
Automatically closes the database if not closed.
Definition: Database.h:74
FileManager * file_manager() const
Definition: Database.h:108
const std::string & GetLastDBPath() const
Definition: Database.h:159
BufferManager * m_buf_manager
Definition: Database.h:167
void CreateTable(absl::string_view tabname, std::vector< Oid > coltypid, std::vector< uint64_t > coltypparam={}, const std::vector< absl::string_view > &field_names={}, std::vector< bool > colisnullable={}, std::vector< bool > colisarray={})
Creates a table named tabname'', withcoltypid.size()'' columns.
Definition: Database.cpp:143
CatCache * m_catcache
Definition: Database.h:168
void close()
Closes the database.
Definition: Database.cpp:111
void CreateIndex(absl::string_view idxname, Oid idxtabid, IdxType idxtyp, bool idxunique, std::vector< FieldId > idxcoltabcolids, std::vector< Oid > idxcolltfuncids={}, std::vector< Oid > idxcoleqfuncids={})
Createa an index named idxname'' and inserts into the catalog.
Definition: Database.cpp:173
CatCache * catcache() const
Definition: Database.h:118
static void init_global()
Initializes all the global objects that are not associated with a particular database.
Definition: Database.cpp:38
Database()
A trivial constructor.
Definition: Database.h:68
void open(const std::string &path, size_t bpool_size, bool create, bool allow_overwrite=false)
Initializes the database components and opens or creates the database at the specified path.
Definition: Database.cpp:50
FileManager exposes a virtual file interface based on FSFile.
Definition: FileManager.h:174
A Schema object stores the information for accessing an ordered set of typed fields either from a dis...
Definition: Schema.h:39
bool g_test_no_index
Set this to true if you don't want the Database to disallow building any index (including the catalog...
Definition: Database.cpp:33
uint32_t Oid
Definition: tdb_base.h:210
uint8_t IdxType
The index type, see index/idxtyps.h.
Definition: tdb_base.h:284
bool g_test_no_catcache
Set this to true if you don't want Database to create and initialize the catalog and its cache.
Definition: Database.cpp:31
bool g_test_catcache_use_volatiletree
Set this to true if you want the catalog cache to build volatile tree index over the catalog tables.
Definition: Database.cpp:35
bool g_test_no_bufman
Set this to true if you don't want Database to create and initialize the buffer manager.
Definition: Database.cpp:30
Database *const g_db
The global instance of Database.
Definition: Database.cpp:27
This file contains all the basic definitions in TDB.