-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from CRBroughton/28-add-more-data-types
28 add more data types
- Loading branch information
Showing
11 changed files
with
127 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@crbroughton/sibyl": patch | ||
--- | ||
|
||
Add new datatypes to Sibyl - bool, real, varchar, text and blob |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@crbroughton/sibyl": major | ||
--- | ||
|
||
Introducing new SibylResponse type - acts as a wrapper to convert types from TS to database types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { describe, expect, it } from 'vitest' | ||
import { convertBooleanValues } from '../sibylLib' | ||
|
||
interface TableRow { | ||
id: number | ||
location: string | ||
name: string | ||
booleanTest: boolean | ||
} | ||
|
||
describe('convertBooleanValues tests', () => { | ||
it('converts any boolean values in the array to either 0 or 1', async () => { | ||
const actual = convertBooleanValues<TableRow>([ | ||
{ | ||
id: 1, | ||
booleanTest: false, | ||
location: 'Brighton', | ||
name: 'Craig', | ||
}, | ||
{ | ||
id: 2, | ||
booleanTest: true, | ||
location: 'Leeds', | ||
name: 'Craig', | ||
}, | ||
]) | ||
|
||
const expectation = [ | ||
{ | ||
id: 1, | ||
booleanTest: 0, | ||
location: 'Brighton', | ||
name: 'Craig', | ||
}, | ||
{ | ||
id: 2, | ||
booleanTest: 1, | ||
location: 'Leeds', | ||
name: 'Craig', | ||
}, | ||
] | ||
|
||
expect(actual).toStrictEqual(expectation) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters