Preparing search index...
The search index is not available
@openaddresses/batch-generic
@openaddresses/batch-generic
default
Class default<T>
Type Parameters
T
extends
GenericTable
Index
Constructors
constructor
Properties
generic
pool
Methods
clear
commit
count
delete
from
generate
key
list
primary
Key
required
Primary
Key
stream
Constructors
constructor
new
default
<
T
extends
GenericTable
>
(
pool
:
PostgresJsDatabase
<
any
>
,
generic
:
T
,
)
:
default
<
T
>
Type Parameters
T
extends
GenericTable
Parameters
pool
:
PostgresJsDatabase
<
any
>
generic
:
T
Returns
default
<
T
>
Properties
generic
generic
:
PgTableWithColumns
<
any
>
pool
pool
:
PostgresJsDatabase
<
any
>
Methods
clear
clear
()
:
Promise
<
void
>
Returns
Promise
<
void
>
commit
commit
(
id
:
unknown
,
values
:
object
,
)
:
Promise
<
{
[
K
in
string
]
:
{
[
Key
in
string
as
Key
]
:
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"notNull"
]
extends
true
?
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
:
null
|
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
}
[
K
]
}
,
>
Parameters
id
:
unknown
values
:
object
Returns
Promise
<
{
[
K
in
string
]
:
{
[
Key
in
string
as
Key
]
:
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"notNull"
]
extends
true
?
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
:
null
|
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
}
[
K
]
}
,
>
count
count
(
query
?:
GenericCountInput
)
:
Promise
<
number
>
Parameters
query
:
GenericCountInput
= {}
Returns
Promise
<
number
>
delete
delete
(
id
:
unknown
)
:
Promise
<
void
>
Parameters
id
:
unknown
Returns
Promise
<
void
>
from
from
(
id
:
unknown
,
)
:
Promise
<
{
[
K
in
string
]
:
{
[
Key
in
string
as
Key
]
:
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"notNull"
]
extends
true
?
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
:
null
|
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
}
[
K
]
}
,
>
Parameters
id
:
unknown
Returns
Promise
<
{
[
K
in
string
]
:
{
[
Key
in
string
as
Key
]
:
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"notNull"
]
extends
true
?
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
:
null
|
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
}
[
K
]
}
,
>
generate
generate
(
values
:
{
[
K
in
string
|
number
|
symbol
]
:
(
{
[
Key
in
string
as
RequiredKeyOnly
<
Key
,
T
[
"_"
]
[
"columns"
]
[
Key
]
>
]
:
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"notNull"
]
extends
true
?
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
:
null
|
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
}
&
{
[
Key
in
string
as
OptionalKeyOnly
<
Key
,
T
[
"_"
]
[
"columns"
]
[
Key
]
,
false
>
]
?:
(
...
)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"notNull"
]
extends
true
?
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
:
null
|
(...)
[
(...)
]
[
Key
]
[
"_"
]
[
"data"
]
}
)
[
K
]
}
,
opts
?:
{
upsert
?:
GenerateUpsert
}
,
)
:
Promise
<
{
[
K
in
string
]
:
{
[
Key
in
string
as
Key
]
:
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"notNull"
]
extends
true
?
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
:
null
|
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
}
[
K
]
}
,
>
Parameters
values
:
{
[
K
in
string
|
number
|
symbol
]
:
(
{
[
Key
in
string
as
RequiredKeyOnly
<
Key
,
T
[
"_"
]
[
"columns"
]
[
Key
]
>
]
:
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"notNull"
]
extends
true
?
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
:
null
|
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
}
&
{
[
Key
in
string
as
OptionalKeyOnly
<
Key
,
T
[
"_"
]
[
"columns"
]
[
Key
]
,
false
>
]
?:
(
...
)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"notNull"
]
extends
true
?
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
:
null
|
(...)
[
(...)
]
[
Key
]
[
"_"
]
[
"data"
]
}
)
[
K
]
}
Optional
opts
:
{
upsert
?:
GenerateUpsert
}
Returns
Promise
<
{
[
K
in
string
]
:
{
[
Key
in
string
as
Key
]
:
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"notNull"
]
extends
true
?
T
[
"_"
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
:
null
|
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
}
[
K
]
}
,
>
key
key
(
key
:
string
)
:
PgColumn
Parameters
key
:
string
Returns
PgColumn
list
list
(
query
?:
GenericListInput
,
)
:
Promise
<
GenericList
<
{
[
K
in
string
]
:
{
[
Key
in
string
as
Key
]
:
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"notNull"
]
extends
true
?
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
:
null
|
(...)
[
(...)
]
[
Key
]
[
"_"
]
[
"data"
]
}
[
K
]
}
,
>
,
>
Parameters
query
:
GenericListInput
= {}
Returns
Promise
<
GenericList
<
{
[
K
in
string
]
:
{
[
Key
in
string
as
Key
]
:
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"notNull"
]
extends
true
?
(...)
[
(...)
]
[
"columns"
]
[
Key
]
[
"_"
]
[
"data"
]
:
null
|
(...)
[
(...)
]
[
Key
]
[
"_"
]
[
"data"
]
}
[
K
]
}
,
>
,
>
primary
Key
primaryKey
()
:
null
|
PgColumn
Returns
null
|
PgColumn
required
Primary
Key
requiredPrimaryKey
()
:
PgColumn
Returns
PgColumn
stream
stream
(
query
?:
GenericStreamInput
)
:
GenericEmitter
<
T
>
Parameters
query
:
GenericStreamInput
= {}
Returns
GenericEmitter
<
T
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
generic
pool
Methods
clear
commit
count
delete
from
generate
key
list
primary
Key
required
Primary
Key
stream
@openaddresses/batch-generic
Loading...