Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/tidesdb.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ ffi.cdef[[
int log_level;
size_t block_cache_size;
size_t max_open_sstables;
int log_to_file;
size_t log_truncation_at;
} tidesdb_config_t;

typedef struct {
Expand Down Expand Up @@ -328,6 +330,8 @@ function tidesdb.default_config()
log_level = tidesdb.LogLevel.LOG_INFO,
block_cache_size = 64 * 1024 * 1024,
max_open_sstables = 256,
log_to_file = false,
log_truncation_at = 24 * 1024 * 1024,
}
end

Expand Down Expand Up @@ -771,6 +775,8 @@ function TidesDB.new(config)
c_config.log_level = config.log_level or tidesdb.LogLevel.LOG_INFO
c_config.block_cache_size = config.block_cache_size or 64 * 1024 * 1024
c_config.max_open_sstables = config.max_open_sstables or 256
c_config.log_to_file = config.log_to_file and 1 or 0
c_config.log_truncation_at = config.log_truncation_at or 24 * 1024 * 1024

local db_ptr = ffi.new("void*[1]")
local result = lib.tidesdb_open(c_config, db_ptr)
Expand All @@ -789,6 +795,8 @@ function TidesDB.open(path, options)
log_level = options.log_level or tidesdb.LogLevel.LOG_INFO,
block_cache_size = options.block_cache_size or 64 * 1024 * 1024,
max_open_sstables = options.max_open_sstables or 256,
log_to_file = options.log_to_file or false,
log_truncation_at = options.log_truncation_at or 24 * 1024 * 1024,
}
return TidesDB.new(config)
end
Expand Down
4 changes: 2 additions & 2 deletions tidesdb-0.3.0-1.rockspec → tidesdb-0.3.1-1.rockspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package = "tidesdb"
version = "0.3.0-1"
version = "0.3.1-1"
source = {
url = "git://github.com/tidesdb/tidesdb-lua.git",
tag = "v0.3.0"
tag = "v0.3.1"
}
description = {
summary = "Official Lua bindings for TidesDB - A high-performance embedded key-value storage engine",
Expand Down
Loading