-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Global/Local Secondary Index creation support (#15)
* add Index creation function Co-authored-by: lucemans <[email protected]> * Make test script run build first * Fix return type of selectOneFrom Co-authored-by: lucemans <[email protected]> * Remove forgotten example comment Co-authored-by: Luc <[email protected]> Co-authored-by: lucemans <[email protected]>
- Loading branch information
Showing
4 changed files
with
227 additions
and
37 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,29 @@ | ||
import { createIndexRaw, createLocalIndexRaw } from '../lib'; | ||
|
||
it('Can create a basic table', async () => { | ||
expect( | ||
createIndexRaw<{ buildings: { name: string, city: string } }, 'buildings', 'name' | 'city'>( | ||
'scyllo', | ||
'buildings', | ||
'buildings_city', | ||
'city' | ||
) | ||
).toEqual({ | ||
args: [], | ||
query: 'CREATE INDEX IF NOT EXISTS buildings_city ON scyllo.buildings (city)', | ||
}); | ||
}); | ||
|
||
it('Can create a basic table if not exists', async () => { | ||
expect( | ||
createLocalIndexRaw<{ buildings: { name: string, city: string } }, 'buildings', 'name' | 'city'>( | ||
'scyllo', | ||
'buildings', | ||
'buildings_index', | ||
'name', | ||
'city' | ||
)).toEqual({ | ||
args: [], | ||
query: 'CREATE INDEX IF NOT EXISTS buildings_index ON scyllo.buildings ((name), city)', | ||
}); | ||
}); |
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