0
0
mirror of https://github.com/mattn/go-sqlite3.git synced 2024-11-07 05:18:43 +00:00
go-sqlite3/sqlite3_opt_column_metadata.go
Yasuhiro Matsumoto 1f0dc0a0ef go fmt ./...
2024-01-25 22:55:22 +09:00

23 lines
529 B
Go

//go:build sqlite_column_metadata
// +build sqlite_column_metadata
package sqlite3
/*
#ifndef USE_LIBSQLITE3
#cgo CFLAGS: -DSQLITE_ENABLE_COLUMN_METADATA
#include <sqlite3-binding.h>
#else
#include <sqlite3.h>
#endif
*/
import "C"
// ColumnTableName returns the table that is the origin of a particular result
// column in a SELECT statement.
//
// See https://www.sqlite.org/c3ref/column_database_name.html
func (s *SQLiteStmt) ColumnTableName(n int) string {
return C.GoString(C.sqlite3_column_table_name(s.s, C.int(n)))
}