ruby-ladybug 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b1d33c54dd9d7ffa7c488fcbab32b251daf549ca772d3190a19bca475b17c84
4
- data.tar.gz: 5c74689b9bbcff42b6c3c2a9bf0e89dbafab675966bf91c1a4326bc2231434c6
3
+ metadata.gz: e7a315b69c14d3e654f5af175913b4c08b0829f4c34f171f662c7ae175fe05ba
4
+ data.tar.gz: 44ae9407d1bb8a0355bd411bb759c43197d8ee7ab0f396761fe0110e1bff12ae
5
5
  SHA512:
6
- metadata.gz: 67f33c1849dbe93cf15b0a6df16a8d232ce27319a570aa7fbbbcad3382fbffe0fee40e71984a9d5df63fa0df238826f2aefcd60e984611ec8d85609019511cb5
7
- data.tar.gz: b1e8e192ed387249a6cf5a823caa2a4614ddbc0efbc06ab76de35ff48098b655a132739bda4b30b2f8fc9baab8623696f35b2ad16076eafe773e344574e5e345
6
+ metadata.gz: 58b03a9ff506470db0661de1c8982007ee47fed3e38c8dc9011f6550f609efbd460ced09d8581bee16dd66dadc1a45dc8982c034a80ff39d2ce6d0e4be5a6347
7
+ data.tar.gz: 90006c401b432a91d9ea1de50aad7e4eb6f9e00c021912a363b3b2a0ef41e195706b18ba4251475fe55e9d029f53c7fdd73950e4a72047bada3d747294563905
checksums.yaml.gz.sig CHANGED
Binary file
data/History.md CHANGED
@@ -2,8 +2,16 @@
2
2
 
3
3
  ---
4
4
 
5
+ ## v0.2.0 [2026-07-09] Mahlon E. Smith <mahlon@martini.nu>
6
+
7
+ Improvements:
8
+
9
+ - Add new database configuration options for LadybugDB 0.18.0.
10
+
11
+
12
+
5
13
  ## v0.1.0 [2026-03-09] Michael Granger <ged@FaerieMUD.org>
6
14
 
7
- Renamed from "Kuzu" (which acquired and closed by Apple) and adjusted to
15
+ Renamed from "Kuzu" (which was acquired and closed by Apple) and adjusted to
8
16
  bind against LadybugDB instead.
9
17
 
data/README.md CHANGED
@@ -224,11 +224,12 @@ Because of the way Ruby frees memory when it's shutting down (i.e., the order is
224
224
  ## Authors
225
225
 
226
226
  - Michael Granger <ged@FaerieMUD.org>
227
+ - Mahlon E. Smith <mahlon@martini.nu>
227
228
 
228
229
 
229
230
  ## Copyright
230
231
 
231
- Copyright (c) 2025-2026 Michael Granger
232
+ Copyright (c) 2025-2026 Michael Granger and Mahlon E. Smith
232
233
 
233
234
  Permission is hereby granted, free of charge, to any person obtaining
234
235
  a copy of this software and associated documentation files (the
@@ -52,13 +52,17 @@ rlbug_config_initialize( VALUE self )
52
52
  ptr = ALLOC( lbug_system_config );
53
53
  lbug_system_config defaults = lbug_default_system_config();
54
54
 
55
- ptr->buffer_pool_size = defaults.buffer_pool_size;
56
- ptr->max_num_threads = defaults.max_num_threads;
57
- ptr->enable_compression = defaults.enable_compression;
58
- ptr->read_only = defaults.read_only;
59
- ptr->max_db_size = defaults.max_db_size;
60
- ptr->auto_checkpoint = defaults.auto_checkpoint;
61
- ptr->checkpoint_threshold = defaults.checkpoint_threshold;
55
+ ptr->buffer_pool_size = defaults.buffer_pool_size;
56
+ ptr->max_num_threads = defaults.max_num_threads;
57
+ ptr->enable_compression = defaults.enable_compression;
58
+ ptr->read_only = defaults.read_only;
59
+ ptr->max_db_size = defaults.max_db_size;
60
+ ptr->auto_checkpoint = defaults.auto_checkpoint;
61
+ ptr->checkpoint_threshold = defaults.checkpoint_threshold;
62
+ ptr->throw_on_wal_replay_failure = defaults.throw_on_wal_replay_failure;
63
+ ptr->enable_checksums = defaults.enable_checksums;
64
+ ptr->enable_multi_writes = defaults.enable_multi_writes;
65
+ ptr->enable_default_hash_index = defaults.enable_default_hash_index;
62
66
 
63
67
  RTYPEDDATA_DATA( self ) = ptr;
64
68
  } else {
@@ -169,6 +173,62 @@ rlbug_config_checkpoint_threshold( VALUE self )
169
173
  }
170
174
 
171
175
 
176
+ /*
177
+ * call-seq:
178
+ * config.throw_on_wal_replay_failure() -> true or false
179
+ *
180
+ * Return the throw_on_wal_replay_failure config value.
181
+ */
182
+ static VALUE
183
+ rlbug_config_throw_on_wal_replay_failure( VALUE self )
184
+ {
185
+ lbug_system_config *config = CHECK_CONFIG( self );
186
+ return config->throw_on_wal_replay_failure ? Qtrue : Qfalse;
187
+ }
188
+
189
+
190
+ /*
191
+ * call-seq:
192
+ * config.enable_checksums() -> true or false
193
+ *
194
+ * Return the enable_checksums config value.
195
+ */
196
+ static VALUE
197
+ rlbug_config_enable_checksums( VALUE self )
198
+ {
199
+ lbug_system_config *config = CHECK_CONFIG( self );
200
+ return config->enable_checksums ? Qtrue : Qfalse;
201
+ }
202
+
203
+
204
+ /*
205
+ * call-seq:
206
+ * config.enable_multi_writes() -> true or false
207
+ *
208
+ * Return the enable_multi_writes config value.
209
+ */
210
+ static VALUE
211
+ rlbug_config_enable_multi_writes( VALUE self )
212
+ {
213
+ lbug_system_config *config = CHECK_CONFIG( self );
214
+ return config->enable_multi_writes ? Qtrue : Qfalse;
215
+ }
216
+
217
+
218
+ /*
219
+ * call-seq:
220
+ * config.enable_default_hash_index() -> true or false
221
+ *
222
+ * Return the enable_default_hash_index config value.
223
+ */
224
+ static VALUE
225
+ rlbug_config_enable_default_hash_index( VALUE self )
226
+ {
227
+ lbug_system_config *config = CHECK_CONFIG( self );
228
+ return config->enable_default_hash_index ? Qtrue : Qfalse;
229
+ }
230
+
231
+
172
232
  /*
173
233
  * call-seq:
174
234
  * config.buffer_pool_size = integer
@@ -281,6 +341,69 @@ rlbug_config_checkpoint_threshold_eq( VALUE self, VALUE value )
281
341
  }
282
342
 
283
343
 
344
+ /*
345
+ * call-seq:
346
+ * config.throw_on_wal_replay_failure = true or false
347
+ *
348
+ * Set the throw_on_wal_replay_failure config value.
349
+ */
350
+ static VALUE
351
+ rlbug_config_throw_on_wal_replay_failure_eq( VALUE self, VALUE value )
352
+ {
353
+ lbug_system_config *config = CHECK_CONFIG( self );
354
+ config->throw_on_wal_replay_failure = RTEST( value );
355
+
356
+ return Qtrue;
357
+ }
358
+
359
+
360
+ /*
361
+ * call-seq:
362
+ * config.enable_checksums = true or false
363
+ *
364
+ * Set the enable_checksums config value.
365
+ */
366
+ static VALUE
367
+ rlbug_config_enable_checksums_eq( VALUE self, VALUE value )
368
+ {
369
+ lbug_system_config *config = CHECK_CONFIG( self );
370
+ config->enable_checksums = RTEST( value );
371
+
372
+ return Qtrue;
373
+ }
374
+
375
+
376
+ /*
377
+ * call-seq:
378
+ * config.enable_multi_writes = true or false
379
+ *
380
+ * Set the enable_multi_writes config value.
381
+ */
382
+ static VALUE
383
+ rlbug_config_enable_multi_writes_eq( VALUE self, VALUE value )
384
+ {
385
+ lbug_system_config *config = CHECK_CONFIG( self );
386
+ config->enable_multi_writes = RTEST( value );
387
+
388
+ return Qtrue;
389
+ }
390
+
391
+
392
+ /*
393
+ * call-seq:
394
+ * config.enable_default_hash_index = true or false
395
+ *
396
+ * Set the enable_default_hash_index config value.
397
+ */
398
+ static VALUE
399
+ rlbug_config_enable_default_hash_index_eq( VALUE self, VALUE value )
400
+ {
401
+ lbug_system_config *config = CHECK_CONFIG( self );
402
+ config->enable_default_hash_index = RTEST( value );
403
+
404
+ return Qtrue;
405
+ }
406
+
284
407
 
285
408
  /*
286
409
  * Document-class: Ladybug::Config
@@ -305,6 +428,10 @@ rlbug_init_config( void )
305
428
  rb_define_method( rlbug_cLadybugConfig, "max_db_size", rlbug_config_max_db_size, 0 );
306
429
  rb_define_method( rlbug_cLadybugConfig, "auto_checkpoint", rlbug_config_auto_checkpoint, 0 );
307
430
  rb_define_method( rlbug_cLadybugConfig, "checkpoint_threshold", rlbug_config_checkpoint_threshold, 0 );
431
+ rb_define_method( rlbug_cLadybugConfig, "throw_on_wal_replay_failure", rlbug_config_throw_on_wal_replay_failure, 0 );
432
+ rb_define_method( rlbug_cLadybugConfig, "enable_checksums", rlbug_config_enable_checksums, 0 );
433
+ rb_define_method( rlbug_cLadybugConfig, "enable_multi_writes", rlbug_config_enable_multi_writes, 0 );
434
+ rb_define_method( rlbug_cLadybugConfig, "enable_default_hash_index", rlbug_config_enable_default_hash_index, 0 );
308
435
 
309
436
  rb_define_method( rlbug_cLadybugConfig, "buffer_pool_size=", rlbug_config_buffer_pool_size_eq, 1 );
310
437
  rb_define_method( rlbug_cLadybugConfig, "max_num_threads=", rlbug_config_max_num_threads_eq, 1 );
@@ -313,6 +440,10 @@ rlbug_init_config( void )
313
440
  rb_define_method( rlbug_cLadybugConfig, "max_db_size=", rlbug_config_max_db_size_eq, 1 );
314
441
  rb_define_method( rlbug_cLadybugConfig, "auto_checkpoint=", rlbug_config_auto_checkpoint_eq, 1 );
315
442
  rb_define_method( rlbug_cLadybugConfig, "checkpoint_threshold=", rlbug_config_checkpoint_threshold_eq, 1 );
443
+ rb_define_method( rlbug_cLadybugConfig, "throw_on_wal_replay_failure=", rlbug_config_throw_on_wal_replay_failure_eq, 1 );
444
+ rb_define_method( rlbug_cLadybugConfig, "enable_checksums=", rlbug_config_enable_checksums_eq, 1 );
445
+ rb_define_method( rlbug_cLadybugConfig, "enable_multi_writes=", rlbug_config_enable_multi_writes_eq, 1 );
446
+ rb_define_method( rlbug_cLadybugConfig, "enable_default_hash_index=", rlbug_config_enable_default_hash_index_eq, 1 );
316
447
 
317
448
  rb_require( "ladybug/config" );
318
449
  }
@@ -13,6 +13,9 @@ have_header( 'lbug.h' ) or
13
13
  have_header( 'ruby/thread.h' ) or
14
14
  abort "Your Ruby is too old!"
15
15
 
16
+ have_struct_member( 'lbug_system_config', 'enable_default_hash_index', 'lbug.h' ) or
17
+ abort "Your ladybug library is too old!"
18
+
16
19
  have_func( 'lbug_database_init', 'lbug.h' )
17
20
 
18
21
  create_header()
@@ -19,7 +19,11 @@ class Ladybug::Config
19
19
  "read_only:%s",
20
20
  "max_db_size:%d",
21
21
  "auto_checkpoint:%s",
22
- "checkpoint_threshold:%d"
22
+ "checkpoint_threshold:%d",
23
+ "throw_on_wal_replay_failure:%s",
24
+ "enable_checksums:%s",
25
+ "enable_multi_writes:%s",
26
+ "enable_default_hash_index:%s"
23
27
  ].freeze
24
28
 
25
29
  # The printf pattern used for #inspect output
@@ -60,6 +64,10 @@ class Ladybug::Config
60
64
  self.max_db_size,
61
65
  self.auto_checkpoint,
62
66
  self.checkpoint_threshold,
67
+ self.throw_on_wal_replay_failure,
68
+ self.enable_checksums,
69
+ self.enable_multi_writes,
70
+ self.enable_default_hash_index
63
71
  ]
64
72
 
65
73
  default = super
data/lib/ladybug.rb CHANGED
@@ -13,7 +13,7 @@ module Ladybug
13
13
 
14
14
 
15
15
  # Library version
16
- VERSION = '0.1.0'
16
+ VERSION = '0.2.0'
17
17
 
18
18
 
19
19
  # Set up a logger for Ladybug classes
@@ -19,6 +19,10 @@ RSpec.describe( Ladybug::Config ) do
19
19
  expect( result.max_db_size ).to be_a( Integer )
20
20
  expect( result.auto_checkpoint ).to eq( true )
21
21
  expect( result.checkpoint_threshold ).to be_a( Integer )
22
+ expect( result.throw_on_wal_replay_failure ).to be_truthy
23
+ expect( result.enable_checksums ).to be_truthy
24
+ expect( result.enable_multi_writes ).to be_falsey
25
+ expect( result.enable_default_hash_index ).to be_truthy
22
26
  end
23
27
 
24
28
 
@@ -94,5 +98,40 @@ RSpec.describe( Ladybug::Config ) do
94
98
  end
95
99
 
96
100
 
101
+ it "can disable wal replay throwing" do
102
+ instance = described_class.new
103
+
104
+ expect {
105
+ instance.throw_on_wal_replay_failure = false
106
+ }.to change { instance.throw_on_wal_replay_failure }.to( false )
107
+ end
108
+
109
+
110
+ it "can disable checksums" do
111
+ instance = described_class.new
112
+
113
+ expect {
114
+ instance.enable_checksums = false
115
+ }.to change { instance.enable_checksums }.to( false )
116
+ end
117
+
118
+
119
+ it "can enable multi writes" do
120
+ instance = described_class.new
121
+
122
+ expect {
123
+ instance.enable_multi_writes = true
124
+ }.to change { instance.enable_multi_writes }.to( true )
125
+ end
126
+
127
+
128
+ it "can disable default hash indexes" do
129
+ instance = described_class.new
130
+
131
+ expect {
132
+ instance.enable_default_hash_index = false
133
+ }.to change { instance.enable_default_hash_index }.to( false )
134
+ end
135
+
97
136
  end
98
137
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,10 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-ladybug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
8
+ - Mahlon E. Smith
8
9
  bindir: bin
9
10
  cert_chain:
10
11
  - |
@@ -33,7 +34,7 @@ cert_chain:
33
34
  XdaRMEnt/AVHUzroBR3CWAz/6ZnDF8GS7EK1bOfM+YWqJL30g7PoxpT+UJTqWJtM
34
35
  CCC1LSoBD7OEUiaIMWUo4h7xWIs=
35
36
  -----END CERTIFICATE-----
36
- date: 2026-03-11 00:00:00.000000000 Z
37
+ date: 2026-07-09 00:00:00.000000000 Z
37
38
  dependencies:
38
39
  - !ruby/object:Gem::Dependency
39
40
  name: rake-compiler
@@ -108,6 +109,7 @@ dependencies:
108
109
  description: A Ruby binding for the LadybugDB embedded graph database.
109
110
  email:
110
111
  - ged@FaerieMUD.org
112
+ - mahlon@martini.nu
111
113
  executables: []
112
114
  extensions:
113
115
  - ext/ladybug_ext/extconf.rb
@@ -171,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
173
  - !ruby/object:Gem::Version
172
174
  version: '0'
173
175
  requirements: []
174
- rubygems_version: 4.0.3
176
+ rubygems_version: 4.0.15
175
177
  specification_version: 4
176
178
  summary: A Ruby binding for the LadybugDB embedded graph database.
177
179
  test_files: []
metadata.gz.sig CHANGED
Binary file