Library Documentation
NPM
GitHub
Preparing search index...
The search index is not available
Amplify JS API Documentation
Amplify JS API Documentation
aws-amplify
datastore
StorageAdapter
Interface StorageAdapter
interface
StorageAdapter
{
batchSave
<
T
>
(
modelConstructor
,
items
)
:
Promise
<
[
T
,
OpType
]
[]
>
;
clear
(
)
:
Promise
<
void
>
;
delete
<
T
>
(
modelOrModelConstructor
,
condition
?
)
:
Promise
<
[
T
[]
,
T
[]
]
>
;
query
<
T
>
(
modelConstructor
,
predicate
?
,
pagination
?
)
:
Promise
<
T
[]
>
;
queryOne
<
T
>
(
modelConstructor
,
firstOrLast
)
:
Promise
<
undefined
|
T
>
;
save
<
T
>
(
model
,
condition
?
)
:
Promise
<
[
T
,
INSERT
|
UPDATE
]
[]
>
;
setUp
(
schema
,
namespaceResolver
,
modelInstanceCreator
,
getModelConstructorByModelName
,
appId
?
)
:
Promise
<
void
>
;
}
Hierarchy (
view full
)
SystemComponent
StorageAdapter
Index
Methods
batch
Save
clear
delete
query
query
One
save
set
Up
Methods
batch
Save
batch
Save
<
T
>
(
modelConstructor
,
items
)
:
Promise
<
[
T
,
OpType
]
[]
>
Type Parameters
T
extends
Readonly
<
Record
<
string
,
any
>
>
Parameters
modelConstructor
:
PersistentModelConstructor
<
T
>
items
:
ModelInstanceMetadata
[]
Returns
Promise
<
[
T
,
OpType
]
[]
>
clear
clear
(
)
:
Promise
<
void
>
Returns
Promise
<
void
>
delete
delete
<
T
>
(
modelOrModelConstructor
,
condition
?
)
:
Promise
<
[
T
[]
,
T
[]
]
>
Type Parameters
T
extends
Readonly
<
Record
<
string
,
any
>
>
Parameters
modelOrModelConstructor
:
T
|
PersistentModelConstructor
<
T
>
Optional
condition
:
ModelPredicate
<
T
>
Returns
Promise
<
[
T
[]
,
T
[]
]
>
query
query
<
T
>
(
modelConstructor
,
predicate
?
,
pagination
?
)
:
Promise
<
T
[]
>
Type Parameters
T
extends
Readonly
<
Record
<
string
,
any
>
>
Parameters
modelConstructor
:
PersistentModelConstructor
<
T
>
Optional
predicate
:
ModelPredicate
<
T
>
Optional
pagination
:
PaginationInput
<
T
>
Returns
Promise
<
T
[]
>
query
One
query
One
<
T
>
(
modelConstructor
,
firstOrLast
)
:
Promise
<
undefined
|
T
>
Type Parameters
T
extends
Readonly
<
Record
<
string
,
any
>
>
Parameters
modelConstructor
:
PersistentModelConstructor
<
T
>
firstOrLast
:
QueryOne
Returns
Promise
<
undefined
|
T
>
save
save
<
T
>
(
model
,
condition
?
)
:
Promise
<
[
T
,
INSERT
|
UPDATE
]
[]
>
Type Parameters
T
extends
Readonly
<
Record
<
string
,
any
>
>
Parameters
model
:
T
Optional
condition
:
ModelPredicate
<
T
>
Returns
Promise
<
[
T
,
INSERT
|
UPDATE
]
[]
>
set
Up
set
Up
(
schema
,
namespaceResolver
,
modelInstanceCreator
,
getModelConstructorByModelName
,
appId
?
)
:
Promise
<
void
>
Parameters
schema
:
InternalSchema
namespaceResolver
:
NamespaceResolver
modelInstanceCreator
:
(
<
T
>
(
ModelConstructor
,
init
)
=>
T
)
<
T
>
(
ModelConstructor
,
init
)
:
T
Type Parameters
T
extends
Readonly
<
Record
<
string
,
any
>
>
Parameters
ModelConstructor
:
PersistentModelConstructor
<
T
>
init
:
Partial
<
T
>
Returns
T
getModelConstructorByModelName
:
(
(
namsespaceName
,
modelName
)
=>
PersistentModelConstructor
<
any
>
)
(
namsespaceName
,
modelName
)
:
PersistentModelConstructor
<
any
>
Parameters
namsespaceName
:
NAMESPACES
modelName
:
string
Returns
PersistentModelConstructor
<
any
>
Optional
appId
:
string
Returns
Promise
<
void
>
Settings
Member Visibility
Protected
Private
Inherited
External
Theme
OS
Light
Dark
On This Page
batch
Save
clear
delete
query
query
One
save
set
Up
Amplify JS API Documentation
aws-amplify
@aws-amplify
geo
interactions
predictions
pubsub
adapter-nextjs
datastore-storage-adapter