Skip to content

Commit

Permalink
Allow lowcase ttl @tables property type
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanblock committed Jul 9, 2023
1 parent ff7d980 commit 2342212
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

---

## [3.5.7] 2023-07-09

### Changed

- Allow lowcase `ttl` `@tables` property type

---

## [3.5.6] 2023-06-21

### Fixed
Expand Down
1 change: 1 addition & 0 deletions src/config/pragmas/tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 15 additions & 2 deletions test/unit/src/config/pragmas/tables-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ number-keys
})

test('@tables population (extra params)', t => {
t.plan(18)
t.plan(20)

let arc = parse(`
@tables
string-keys
strID *String
strSort **String
stream true
_ttl TTL
_ttl ttl
pitr true
encrypt true
`)
Expand Down Expand Up @@ -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 => {
Expand Down

0 comments on commit 2342212

Please sign in to comment.