class DuckDB::TableDescription

# name: varchar, default=true
# id: integer, default=false
end
puts “#{cd.name}: #{cd.logical_type.type}, default=#{cd.has_default?}”
td.column_descriptions.each do |cd|
td = DuckDB::TableDescription.new(con, ‘users’)
con.query(‘CREATE TABLE users (id INTEGER, name VARCHAR DEFAULT 'anonymous')’)
con = db.connect
db = DuckDB::Database.open
require ‘duckdb’
Requires DuckDB >= 1.5.0.
whether a column has a default value — for any accessible table.
Use it to retrieve column descriptions — including name, logical type, and
DuckDB::TableDescription provides metadata about a table in DuckDB.

def _column_has_default?(idx)

def _column_has_default?(idx)
  ret = _column_has_default(idx)
  raise DuckDB::Error, error_message || 'failed to determine column has default' if ret.nil?
  ret
end

def column_descriptions

#=> [#, ...]
td.column_descriptions
td = DuckDB::TableDescription.new(con, 't')

con.query("CREATE TABLE t (i INTEGER, j INTEGER DEFAULT 5)")
con = db.connect
db = DuckDB::Database.open
require 'duckdb'

it has a default value defined.
Each element describes a single column's name, logical type, and whether

Returns an array of DuckDB::ColumnDescription objects, one per column.
def column_descriptions
  Array.new(_column_count) do |i|
    ColumnDescription.new(
      name: _column_name(i),
      logical_type: _column_logical_type(i),
      has_default: _column_has_default?(i)
    )
  end
end

def initialize(con, table, schema: nil, catalog: nil)

DuckDB::TableDescription.new(con, 't', schema: 'main')
DuckDB::TableDescription.new(con, 't')

con.query('CREATE TABLE t (i INTEGER)')
con = db.connect
db = DuckDB::Database.open
require 'duckdb'

or the table (or schema/catalog) does not exist.
Raises DuckDB::Error if the connection is invalid, the table name is nil,

Optionally pass +schema:+ and/or +catalog:+ to qualify the table.
+con+ must be a DuckDB::Connection. +table+ is the table name (String).

Creates a new TableDescription for the given table.
def initialize(con, table, schema: nil, catalog: nil)
  raise DuckDB::Error, '1st argument must be DuckDB::Connection object.' unless con.is_a?(DuckDB::Connection)
  raise DuckDB::Error, '2nd argument must be table name.' if table.nil?
  raise DuckDB::Error, error_message unless _initialize(con, catalog, schema, table)
end