sqlite3_opt_column_metadata.go 495 B

123456789101112131415161718192021
  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. }