Data Imported into a Time-Series Table Using Drivers
Sensor or monitoring data can be imported into a time-series table using COPY of Libpq, JDBC, ODBC, GO, and Python. One or more data records can be inserted. Before data write, you need to create a time-series table first or ensure that there is time-series tables in the system.
Precautions
- The prepare and COPY of Libpq, JDBC, and GO are supported for data inserted into a time-series table.
- The ODBC prepare is supported for data inserted into a time-series table.
Syntax Format
-
Libpq drivers
PQprepare PQexecPrepared PQputCopyData
-
JDBC drivers
java.sql.PreparedStatement CopyManager
-
ODBC drivers
SQLPrepare SQLExecute --COPY is not supported.
-
GO drivers
Prepare() Exec()
Examples
-
JDBC prepare interface: https://docs.mogdb.io/zh/mogdb/v3.0/5-java-sql-PreparedStatement
JDBC prepare example: https://docs.mogdb.io/zh/mogdb/v3.0/7-running-sql-statements
-
JDBC COPY interface: https://docs.mogdb.io/zh/mogdb/v3.0/14-CopyManager
JDBC COPY example (unofficial): https://blog.csdn.net/ifenggege/article/details/108905808
-
Libpq prepare interface: https://docs.mogdb.io/zh/mogdb/v3.0/11-PQprepare
Libpq prepare example (unofficial): https://www.cnblogs.com/gaojian/p/3140491.html
-
Libpq COPY interface (unofficial): http://www.postgres.cn/docs/10/libpq-copy.html
Libpq COPY example (unofficial): https://blog.csdn.net/liufeng1980423/article/details/108254469
-
GO prepare example (unofficial): https://vimsky.com/examples/usage/golang_database_sql_DB_Prepare.html
-
GO COPY example (unofficial): https://pkg.go.dev/github.com/lib/pq#section-readme