forked from aws-amplify/amplify-js
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes to naming and updates regarding feedback from Draft PR
- Loading branch information
Showing
12 changed files
with
72 additions
and
68 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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.insertSpaces": false, | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"prettier.requireConfig": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} | ||
}, | ||
"typescript.format.insertSpaceBeforeAndAfterBinaryOperators": false, | ||
"javascript.format.insertSpaceBeforeAndAfterBinaryOperators": false | ||
} |
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
2 changes: 1 addition & 1 deletion
2
packages/datastore-storage-adapter/src/ExpoSQLiteAdapter/ExpoSQLiteAdapter.ts
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
2 changes: 1 addition & 1 deletion
2
packages/datastore-storage-adapter/src/SQLiteAdapter/SQLiteAdapter.ts
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
File renamed without changes.
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,54 @@ | ||
import { GraphQLScalarType } from '@aws-amplify/datastore'; | ||
import { PersistentModel } from '@aws-amplify/datastore'; | ||
import { ParameterizedStatement } from './SQLiteUtils'; | ||
|
||
export function getSQLiteType( | ||
scalar: keyof Omit< | ||
typeof GraphQLScalarType, | ||
'getJSType' | 'getValidationFunction' | 'getSQLiteType' | ||
> | ||
): 'TEXT' | 'INTEGER' | 'REAL' | 'BLOB' { | ||
switch (scalar) { | ||
case 'Boolean': | ||
case 'Int': | ||
case 'AWSTimestamp': | ||
return 'INTEGER'; | ||
case 'ID': | ||
case 'String': | ||
case 'AWSDate': | ||
case 'AWSTime': | ||
case 'AWSDateTime': | ||
case 'AWSEmail': | ||
case 'AWSJSON': | ||
case 'AWSURL': | ||
case 'AWSPhone': | ||
case 'AWSIPAddress': | ||
return 'TEXT'; | ||
case 'Float': | ||
return 'REAL'; | ||
default: | ||
const _: never = scalar as never; | ||
throw new Error(`unknown type ${scalar as string}`); | ||
} | ||
} | ||
|
||
export interface CommonSQLiteDatabase { | ||
init(): Promise<void>; | ||
createSchema(statements: string[]): Promise<void>; | ||
clear(): Promise<void>; | ||
get<T extends PersistentModel>(statement: string, params: any[]): Promise<T>; | ||
getAll<T extends PersistentModel>( | ||
statement: string, | ||
params: any[] | ||
): Promise<T[]>; | ||
save(statement: string, params: any[]): Promise<void>; | ||
batchQuery(queryStatements: Set<ParameterizedStatement>): Promise<any[]>; | ||
batchSave( | ||
saveStatements: Set<ParameterizedStatement>, | ||
deleteStatements?: Set<ParameterizedStatement> | ||
): Promise<void>; | ||
selectAndDelete( | ||
query: ParameterizedStatement, | ||
_delete: ParameterizedStatement | ||
): Promise<any[]>; | ||
} |
23 changes: 0 additions & 23 deletions
23
packages/datastore-storage-adapter/src/commons/Database.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.