Function
| Static Public Summary | ||
| public |
connect(r: *, objectPattern1: {"host": *, "port": *, "db": *, "maxAttempts": *, "baseTimeout": *, "maxTimeout": *}): * connect to the db, using |
|
| public |
ensureDB(r: *, conn: *, dbName: *): * makes sure a db exists by attempting to create it and suppressing the error if it already exists. |
|
| public |
ensureIndex(r: *, conn: *, tableName: *, indexName: *, indexCreateOptions: ...*): * ensure that an index exists on a table, creating if necessary. |
|
| public |
ensureTable(r: *, conn: *, tableName: *): * makes sure a table exists by attempting to create it and suppressing the error if it already exists. |
|
Static Public
public connect(r: *, objectPattern1: {"host": *, "port": *, "db": *, "maxAttempts": *, "baseTimeout": *, "maxTimeout": *}): * source
import {connect} from '@nrser/supermodel-rethinkdb/src/util.js'connect to the db, using .attemptToConnect internally.
by default will continue to try connecting every timeout milliseconds
(default 1000ms = 1s).
Params:
| Name | Type | Attribute | Description |
| r | * | ||
| objectPattern1 | {"host": *, "port": *, "db": *, "maxAttempts": *, "baseTimeout": *, "maxTimeout": *} |
|
Return:
| * |
public ensureDB(r: *, conn: *, dbName: *): * source
import {ensureDB} from '@nrser/supermodel-rethinkdb/src/util.js'makes sure a db exists by attempting to create it and suppressing the error if it already exists.
Params:
| Name | Type | Attribute | Description |
| r | * | ||
| conn | * | ||
| dbName | * |
Return:
| * | [Promise<boolean>] true if the db was created. |
public ensureIndex(r: *, conn: *, tableName: *, indexName: *, indexCreateOptions: ...*): * source
import {ensureIndex} from '@nrser/supermodel-rethinkdb/src/util.js'ensure that an index exists on a table, creating if necessary.
returns Promise<boolean> that resolved true if the index was created
and false if it was already there.
Params:
| Name | Type | Attribute | Description |
| r | * | ||
| conn | * | ||
| tableName | * | ||
| indexName | * | ||
| indexCreateOptions | ...* |
Return:
| * |
public ensureTable(r: *, conn: *, tableName: *): * source
import {ensureTable} from '@nrser/supermodel-rethinkdb/src/util.js'makes sure a table exists by attempting to create it and suppressing the error if it already exists.
Params:
| Name | Type | Attribute | Description |
| r | * | ||
| conn | * | ||
| tableName | * |
Return:
| * | [Promise<boolean>] true if the table was created. |