@sideloop/core
Preparing search index...
ExecutionContructor
Interface ExecutionContructor<M, TB>
interface
ExecutionContructor
<
M
,
TB
>
{
new
ExecutionContructor
(
attrs
:
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
SelectType
<
TB
[
K
]
>
}
,
>
,
)
:
ModelShape
<
TB
>
;
all
()
:
Promise
<
M
[]
>
;
attributesFromJob
(
job
:
Job
,
)
:
{
jobId
:
number
;
priority
:
number
;
queueName
:
string
}
;
count
()
:
Promise
<
number
>
;
create
(
attrs
:
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
,
options
?:
{
ignoreConflict
:
keyof
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
;
}
,
)
:
Promise
<
M
>
;
createAll
(
attrs
:
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
[]
,
)
:
Promise
<
M
[]
>
;
createAllFromJobs
(
jobs
:
Job
[]
)
:
Promise
<
void
>
;
createUnique
(
attrs
:
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
,
uniqueBy
:
keyof
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
,
)
:
Promise
<
null
|
M
>
;
destroy
(
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
)
:
Promise
<
number
>
;
discardAllFromJobs
(
jobs
:
Job
[]
)
:
Promise
<
void
>
;
discardAllInBatches
(
opts
?:
{
batchSize
?:
number
;
queue
?:
string
}
,
)
:
Promise
<
void
>
;
findAll
(
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
)
:
Promise
<
M
[]
>
;
findById
(
id
:
number
)
:
Promise
<
null
|
M
>
;
findByIdOrThrow
(
id
:
number
)
:
Promise
<
M
>
;
findOne
(
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
)
:
Promise
<
null
|
M
>
;
findOneOrThrow
(
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
)
:
Promise
<
M
>
;
last
()
:
Promise
<
null
|
M
>
;
last
(
limit
:
1
)
:
Promise
<
null
|
M
>
;
last
(
limit
:
number
)
:
Promise
<
M
[]
>
;
transaction
<
T
>
(
cb
:
(
tx
:
Transaction
<
Database
>
)
=>
Promise
<
T
>
)
:
Promise
<
T
>
;
updateAll
(
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
)
:
Promise
<
number
>
;
}
Type Parameters
M
TB
Hierarchy (
View Summary
)
ModelConstructor
<
M
,
TB
>
ExecutionContructor
Index
Constructors
constructor
Methods
all
attributes
From
Job
count
create
create
All
create
All
From
Jobs
create
Unique
destroy
discard
All
From
Jobs
discard
All
In
Batches
find
All
find
By
Id
find
By
Id
Or
Throw
find
One
find
One
Or
Throw
last
transaction
update
All
Constructors
constructor
new
ExecutionContructor
(
attrs
:
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
SelectType
<
TB
[
K
]
>
}
,
>
,
)
:
ModelShape
<
TB
>
Parameters
attrs
:
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
SelectType
<
TB
[
K
]
>
}
>
Returns
ModelShape
<
TB
>
Methods
all
all
()
:
Promise
<
M
[]
>
Returns
Promise
<
M
[]
>
attributes
From
Job
attributesFromJob
(
job
:
Job
,
)
:
{
jobId
:
number
;
priority
:
number
;
queueName
:
string
}
Parameters
job
:
Job
Returns
{
jobId
:
number
;
priority
:
number
;
queueName
:
string
}
count
count
()
:
Promise
<
number
>
Returns
Promise
<
number
>
create
create
(
attrs
:
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
,
options
?:
{
ignoreConflict
:
keyof
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
;
}
,
)
:
Promise
<
M
>
Parameters
attrs
:
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
Optional
options
:
{
ignoreConflict
:
keyof
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
;
}
Returns
Promise
<
M
>
create
All
createAll
(
attrs
:
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
[]
,
)
:
Promise
<
M
[]
>
Parameters
attrs
:
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
[]
Returns
Promise
<
M
[]
>
create
All
From
Jobs
createAllFromJobs
(
jobs
:
Job
[]
)
:
Promise
<
void
>
Parameters
jobs
:
Job
[]
Returns
Promise
<
void
>
create
Unique
createUnique
(
attrs
:
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
,
uniqueBy
:
keyof
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
,
)
:
Promise
<
null
|
M
>
Parameters
attrs
:
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
uniqueBy
:
keyof
DrainOuterGeneric
<
{
[
K
in
string
|
number
|
symbol
]
:
InsertType
<
TB
[
K
]
>
}
&
{
[
K
in
string
|
number
|
symbol
]
?:
InsertType
<
TB
[
K
]
>
}
,
>
Returns
Promise
<
null
|
M
>
destroy
destroy
(
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
)
:
Promise
<
number
>
Parameters
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
Returns
Promise
<
number
>
discard
All
From
Jobs
discardAllFromJobs
(
jobs
:
Job
[]
)
:
Promise
<
void
>
Parameters
jobs
:
Job
[]
Returns
Promise
<
void
>
discard
All
In
Batches
discardAllInBatches
(
opts
?:
{
batchSize
?:
number
;
queue
?:
string
}
,
)
:
Promise
<
void
>
Parameters
Optional
opts
:
{
batchSize
?:
number
;
queue
?:
string
}
Returns
Promise
<
void
>
find
All
findAll
(
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
)
:
Promise
<
M
[]
>
Parameters
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
Returns
Promise
<
M
[]
>
find
By
Id
findById
(
id
:
number
)
:
Promise
<
null
|
M
>
Parameters
id
:
number
Returns
Promise
<
null
|
M
>
find
By
Id
Or
Throw
findByIdOrThrow
(
id
:
number
)
:
Promise
<
M
>
Parameters
id
:
number
Returns
Promise
<
M
>
find
One
findOne
(
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
)
:
Promise
<
null
|
M
>
Parameters
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
Returns
Promise
<
null
|
M
>
find
One
Or
Throw
findOneOrThrow
(
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
)
:
Promise
<
M
>
Parameters
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
Returns
Promise
<
M
>
last
last
()
:
Promise
<
null
|
M
>
Returns
Promise
<
null
|
M
>
last
(
limit
:
1
)
:
Promise
<
null
|
M
>
Parameters
limit
:
1
Returns
Promise
<
null
|
M
>
last
(
limit
:
number
)
:
Promise
<
M
[]
>
Parameters
limit
:
number
Returns
Promise
<
M
[]
>
transaction
transaction
<
T
>
(
cb
:
(
tx
:
Transaction
<
Database
>
)
=>
Promise
<
T
>
)
:
Promise
<
T
>
Type Parameters
T
Parameters
cb
:
(
tx
:
Transaction
<
Database
>
)
=>
Promise
<
T
>
Returns
Promise
<
T
>
update
All
updateAll
(
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
)
:
Promise
<
number
>
Parameters
cb
:
(
db
:
Kysely
<
Database
>
)
=>
CompiledQuery
Returns
Promise
<
number
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Methods
all
attributes
From
Job
count
create
create
All
create
All
From
Jobs
create
Unique
destroy
discard
All
From
Jobs
discard
All
In
Batches
find
All
find
By
Id
find
By
Id
Or
Throw
find
One
find
One
Or
Throw
last
transaction
update
All
@sideloop/core
Loading...