ITableSession defines an interface for interacting with IoTDB tables. It supports operations such as data insertion, executing queries, and closing the session. Implementations of this interface are expected to manage connections and ensure proper resource cleanup. Each method may return an error t
| 30 | // Since this interface includes a Close method, it is recommended to use |
| 31 | // defer to ensure the session is properly closed. |
| 32 | type ITableSession interface { |
| 33 | |
| 34 | // Insert inserts a Tablet into the database. |
| 35 | // |
| 36 | // Parameters: |
| 37 | // - tablet: A pointer to a Tablet containing time-series data to be inserted. |
| 38 | // |
| 39 | // Returns: |
| 40 | // - err: An error if an issue occurs during the operation, such as a connection error or execution failure. |
| 41 | Insert(tablet *Tablet) error |
| 42 | |
| 43 | // ExecuteNonQueryStatement executes a non-query SQL statement, such as a DDL or DML command. |
| 44 | // |
| 45 | // Parameters: |
| 46 | // - sql: The SQL statement to execute. |
| 47 | // |
| 48 | // Returns: |
| 49 | // - err: An error if an issue occurs during the operation, such as a connection error or execution failure. |
| 50 | ExecuteNonQueryStatement(sql string) error |
| 51 | |
| 52 | // ExecuteQueryStatement executes a query SQL statement and returns the result set. |
| 53 | // |
| 54 | // Parameters: |
| 55 | // - sql: The SQL query statement to execute. |
| 56 | // - timeoutInMs: A pointer to the timeout duration in milliseconds for the query execution. |
| 57 | // |
| 58 | // Returns: |
| 59 | // - result: A pointer to SessionDataSet containing the query results. |
| 60 | // - err: An error if an issue occurs during the operation, such as a connection error or execution failure. |
| 61 | ExecuteQueryStatement(sql string, timeoutInMs *int64) (*SessionDataSet, error) |
| 62 | |
| 63 | // Close closes the session, releasing any held resources. |
| 64 | // |
| 65 | // Returns: |
| 66 | // - err: An error if there is an issue with closing the IoTDB connection. |
| 67 | Close() (err error) |
| 68 | } |
| 69 | |
| 70 | // TableSession represents a session for interacting with IoTDB in relational mode. |
| 71 | // It wraps a Session instance, providing methods for executing SQL statements |
no outgoing calls
no test coverage detected
searching dependent graphs…