Fork github.com/mattn/go-sqlite3 with adjustment for go1.16.2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
495 B

  1. // +build sqlite_column_metadata
  2. package sqlite3
  3. /*
  4. #ifndef USE_LIBSQLITE3
  5. #cgo CFLAGS: -DSQLITE_ENABLE_COLUMN_METADATA
  6. #include <sqlite3-binding.h>
  7. #else
  8. #include <sqlite3.h>
  9. #endif
  10. */
  11. import "C"
  12. // ColumnTableName returns the table that is the origin of a particular result
  13. // column in a SELECT statement.
  14. //
  15. // See https://www.sqlite.org/c3ref/column_database_name.html
  16. func (s *SQLiteStmt) ColumnTableName(n int) string {
  17. return C.GoString(C.sqlite3_column_table_name(s.s, C.int(n)))
  18. }