From 2718ae09f4fe01a2cf58dc5d5e65768fce5b7aa1 Mon Sep 17 00:00:00 2001 From: Ryan Block Date: Sun, 9 Jul 2023 13:38:20 -0700 Subject: [PATCH] Allow lowcase `ttl` @tables property type --- changelog.md | 8 ++++++++ src/config/pragmas/tables.js | 1 + test/unit/src/config/pragmas/tables-test.js | 17 +++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index a0bdd7a..67a4646 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,14 @@ --- +## [3.5.7] 2023-07-09 + +### Changed + +- Allow lowcase `ttl` `@tables` property type + +--- + ## [3.5.6] 2023-06-21 ### Fixed diff --git a/src/config/pragmas/tables.js b/src/config/pragmas/tables.js index 6b187e7..c49a76f 100644 --- a/src/config/pragmas/tables.js +++ b/src/config/pragmas/tables.js @@ -47,6 +47,7 @@ module.exports = function configureTables ({ arc, inventory, errors }) { } if (key === 'stream') t.stream = value if (value === 'TTL') t.ttl = key + if (value === 'ttl') t.ttl = key if (key === 'encrypt') t.encrypt = value if (key === 'PITR') t.pitr = value if (key === 'pitr') t.pitr = value diff --git a/test/unit/src/config/pragmas/tables-test.js b/test/unit/src/config/pragmas/tables-test.js index 4ccfce6..8e79181 100644 --- a/test/unit/src/config/pragmas/tables-test.js +++ b/test/unit/src/config/pragmas/tables-test.js @@ -53,7 +53,7 @@ number-keys }) test('@tables population (extra params)', t => { - t.plan(18) + t.plan(20) let arc = parse(` @tables @@ -61,7 +61,7 @@ string-keys strID *String strSort **String stream true - _ttl TTL + _ttl ttl pitr true encrypt true `) @@ -117,6 +117,19 @@ string-keys tables = populateTables({ arc, inventory }) t.ok(tables.length === 1, 'Got correct number of tables back') t.equal(tables[0].pitr, true, 'Got back correct pitr value') + + // Alt TTL casing + arc = parse(` +@tables +string-keys + strID *String + strSort **String + _ttl TTL +`) + inventory = inventoryDefaults() + tables = populateTables({ arc, inventory }) + t.ok(tables.length === 1, 'Got correct number of tables back') + t.equal(tables[0].ttl, '_ttl', 'Got back correct TTL value') }) test('@tables population: plugin setter', t => {