diff options
author | Urban Müller | 2016-11-10 15:48:46 +0100 |
---|---|---|
committer | Urban Müller | 2016-11-10 15:48:46 +0100 |
commit | 01ce86d79be6d17bbf011826a77086e50652105b (patch) | |
tree | 99553f06c855e54c2fc06a3a8c6cb51fcd59060b /tests/it_dbi.t | |
parent | e456347ffea5ee15fba229525f22a96b78865455 (diff) | |
download | itools-01ce86d79be6d17bbf011826a77086e50652105b.tar.gz itools-01ce86d79be6d17bbf011826a77086e50652105b.tar.bz2 itools-01ce86d79be6d17bbf011826a77086e50652105b.zip |
allow dynamic columns
Diffstat (limited to 'tests/it_dbi.t')
-rwxr-xr-x | tests/it_dbi.t | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/it_dbi.t b/tests/it_dbi.t index 006c4d8..961a747 100755 --- a/tests/it_dbi.t +++ b/tests/it_dbi.t @@ -10,6 +10,7 @@ $dbi->query('create temporary table it_dbi_test ( ID int not null auto_increment, x int, foo varchar(42), + dyncols LONGBLOB, primary key(ID) );'); @@ -315,3 +316,14 @@ is( array(1, "franz"), "localized field foobar_fr" ); + +# +# Test saving/retrieving/matching values in dynamically created columns +# +$record = new it_dbi_test; +$record->replace('ID' => 5, 'key1' => "val1"); is($record->key1, "val1"); +$record->update('key2' => "val2"); is($record->key1, "val1"); is($record->key2, "val2"); +$record->update('-key3' => "2*2"); is($record->key1, "val1"); is($record->key2, "val2"); is($record->key3, 4); +$record->update('key1' => "val0"); is($record->key1, "val0"); is($record->key2, "val2"); is($record->key3, 4); +$record->replace('ID' => 6, 'key4' => "val4"); is($record->key4, "val4"); +$record->select('key2' => "val2"); is($record->key2, "val2"); is($record->key4, null, "clear previous fields"); |