Firebird
Firebird
The Firebird module is responsible for connecting to a Firebird DBMS, performing queries and handling the results inside the robot.
Methods
connection
Method responsible for creating a connection with a Firebird database.
js
const connection = await Database.Firebird.connection["v1_0_0"]({
connectionString: `firebird://userRoberty:robertyBD123@localhost:3050/robertyBD`,
})
Required parameters
connectionString: String - expects a string with the connection parameters. The standard must be followed as in the example shown earlier.
Optional parameters
This action has no optional parameters.
Return
This action has no returns.
close
Method responsible for closing an open connection with a Firebird database.
js
await Database.Firebird.close["v1_0_0"]({
connection: connection,
})
Required parameters
connection: Return of the connection action - expects the connection obtained through the connection action.
Optional parameters
This action has no optional parameters.
Return
This action has no returns.
query
Method responsible for performing a query directly in the database through the connection obtained by the connection action.
js
const query = await Database.Firebird.query["v1_0_0"]({
query: `SELECT * FROM tabela`,
connection: connection,
timeout: 120
})
Required parameters
connection: Return of the connection action - expects the connection obtained through the connection action.query: String - expects a string with the query to be performed.
Optional parameters
timeout: Number - expects a value in milliseconds to wait for the execution of the query.
Return
The constant or variable created, such as the query of the example shown earlier, receives a value of the Object type. The object returned has the following properties:
query.query: String - returns the query that was used.query.results: Array - returns every result obtained with the query.query.resultsCount: Number - returns the number of rows obtained in the result.