sqlite3_opt_column_metadata.go 529 B

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