File: sqlite3_opt_column_metadata.go

package info (click to toggle)
icingadb 1.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 40,272 kB
  • sloc: ansic: 155,865; asm: 5,498; sql: 3,497; sh: 1,406; cpp: 1,132; makefile: 357; xml: 160
file content (21 lines) | stat: -rw-r--r-- 495 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// +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)))
}