Constructor
new Sender(options)
Creates an instance of Sender.
Parameters:
Name | Type | Description |
---|---|---|
options |
object | Configuration options. Properties of the object:
|
- Source:
Methods
at(timestamp)
Closing the row after writing the designated timestamp into the buffer of the sender.
Parameters:
Name | Type | Description |
---|---|---|
timestamp |
string | A string represents the designated timestamp in nanoseconds. |
- Source:
atNow()
Closing the row without writing designated timestamp into the buffer of the sender.
Designated timestamp will be populated by the server on this record.
Designated timestamp will be populated by the server on this record.
- Source:
booleanColumn(name, value) → {Sender}
Write a boolean column with its value into the buffer of the sender.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Column name. |
value |
boolean | Column value, accepts only boolean values. |
- Source:
Returns:
Returns with a reference to this sender.
- Type
- Sender
(async) close()
Closes the connection to the database.
Data sitting in the Sender's buffer will be lost unless flush() is called before close().
Data sitting in the Sender's buffer will be lost unless flush() is called before close().
- Source:
(async) connect(options, secureopt)
Creates a connection to the database.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
net.NetConnectOpts | tls.ConnectionOptions | Connection options, host and port are required. | ||
secure |
boolean |
<optional> |
false | If true connection will use TLS encryption. |
- Source:
floatColumn(name, value) → {Sender}
Write a float column with its value into the buffer of the sender.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Column name. |
value |
number | Column value, accepts only number values. |
- Source:
Returns:
Returns with a reference to this sender.
- Type
- Sender
(async) flush() → {Promise.<boolean>}
Sends the buffer's content to the database and compacts the buffer.
If the last row is not finished it stays in the sender's buffer.
- Source:
Returns:
Resolves to true if there was data in the buffer to send.
- Type
- Promise.<boolean>
intColumn(name, value) → {Sender}
Write an integer column with its value into the buffer of the sender.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Column name. |
value |
number | Column value, accepts only number values. |
- Source:
Returns:
Returns with a reference to this sender.
- Type
- Sender
reset() → {Sender}
Resets the buffer, data added to the buffer will be lost.
In other words it clears the buffer and sets the writing position to the beginning of the buffer.
In other words it clears the buffer and sets the writing position to the beginning of the buffer.
- Source:
Returns:
Returns with a reference to this sender.
- Type
- Sender
resize(bufferSize)
Extends the size of the sender's buffer.
Can be used to increase the size of buffer if overflown. The buffer's content is copied into the new buffer.
Can be used to increase the size of buffer if overflown. The buffer's content is copied into the new buffer.
Parameters:
Name | Type | Description |
---|---|---|
bufferSize |
number | New size of the buffer used by the sender, provided in bytes. |
- Source:
stringColumn(name, value) → {Sender}
Write a string column with its value into the buffer of the sender.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Column name. |
value |
string | Column value, accepts only string values. |
- Source:
Returns:
Returns with a reference to this sender.
- Type
- Sender
symbol(name, value) → {Sender}
Write a symbol name and value into the buffer of the sender.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Symbol name. |
value |
any | Symbol value, toString() will be called to extract the actual symbol value from the parameter. |
- Source:
Returns:
Returns with a reference to this sender.
- Type
- Sender
table(table) → {Sender}
Write the table name into the buffer of the sender.
Parameters:
Name | Type | Description |
---|---|---|
table |
string | Table name. |
- Source:
Returns:
Returns with a reference to this sender.
- Type
- Sender
timestampColumn(name, value) → {Sender}
Write a timestamp column with its value into the buffer of the sender.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Column name. |
value |
number | Column value, accepts only number objects. |
- Source:
Returns:
Returns with a reference to this sender.
- Type
- Sender