0
0
mirror of https://github.com/mattn/go-sqlite3.git synced 2025-05-24 14:54:48 +00:00
Files
go-sqlite3/sqlite3_opt_column_metadata.go
Yasuhiro Matsumoto 01b1e89847 Move C code to amalgamation
Fixes #1020
2022-02-24 08:44:41 +09:00

22 lines
508 B
Go

// +build sqlite_column_metadata
package sqlite3
/*
#ifndef USE_LIBSQLITE3
#cgo CFLAGS: -DSQLITE_ENABLE_COLUMN_METADATA
#include "amalgamation/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)))
}