Class: OCI8::Metadata::Database

Inherits:
Base
  • Object
show all
Defined in:
lib/oci8/metadata.rb

Overview

Metadata for a database.

This is returned by:

  • OCI8#describe_database(database_name)

Instance Method Summary collapse

Methods inherited from Base

#obj_id, #obj_name, #obj_schema

Instance Method Details

#autocommit_ddlObject

Is autocommit mode required for DDL statements? Values are :ac_ddl and :no_ac_ddl



1820
1821
1822
1823
1824
1825
# File 'lib/oci8/metadata.rb', line 1820

def autocommit_ddl
  case attr_get_ub1(OCI_ATTR_AUTOCOMMIT_DDL)
  when 0; :ac_ddl
  when 1; :no_ac_ddl
  end
end

#catalog_locationObject

Position of the catalog in a qualified table. Values are :cl_start and :cl_end



1793
1794
1795
1796
1797
1798
# File 'lib/oci8/metadata.rb', line 1793

def catalog_location
  case attr_get_ub1(OCI_ATTR_CATALOG_LOCATION)
  when 0; :cl_start
  when 1; :cl_end
  end
end

#charset_idObject

database character set Id



1747
1748
1749
# File 'lib/oci8/metadata.rb', line 1747

def charset_id
  attr_get_ub2(OCI_ATTR_CHARSET_ID)
end

#charset_nameObject

database character set name



1837
1838
1839
# File 'lib/oci8/metadata.rb', line 1837

def charset_name
  __charset_name(charset_id)
end

#cursor_commit_behaviorObject

How a COMMIT operation affects cursors and prepared statements in the database. Values are:

:cusror_open

preserve cursor state as before the commit operation

:cursor_closed

cursors are closed on COMMIT, but the application can still re-execute the statement without re-preparing it



1779
1780
1781
1782
1783
1784
# File 'lib/oci8/metadata.rb', line 1779

def cursor_commit_behavior
  case attr_get_ub1(OCI_ATTR_CURSOR_COMMIT_BEHAVIOR)
  when 0; :cusror_open
  when 1; :cursor_closed
  end
end

#inspectObject

:nodoc:



1851
1852
1853
# File 'lib/oci8/metadata.rb', line 1851

def inspect # :nodoc:
  "#<#{self.class.name}:(#{obj_id}) #{obj_name} #{version}>"
end

#locking_modeObject

Locking mode for the database. Values are :lock_immediate and :lock_delayed



1829
1830
1831
1832
1833
1834
# File 'lib/oci8/metadata.rb', line 1829

def locking_mode
  case attr_get_ub1(OCI_ATTR_LOCKING_MODE)
  when 0; :lock_immediate
  when 1; :lock_delayed
  end
end

#max_catalog_namelenObject

Maximum length of a catalog (database) name



1787
1788
1789
# File 'lib/oci8/metadata.rb', line 1787

def max_catalog_namelen
  attr_get_ub1(OCI_ATTR_MAX_CATALOG_NAMELEN)
end

#max_column_lenObject

Maximum length of a column name



1768
1769
1770
# File 'lib/oci8/metadata.rb', line 1768

def max_column_len
  attr_get_ub4(OCI_ATTR_MAX_COLUMN_LEN)
end

#max_proc_lenObject

Maximum length of a procedure name



1763
1764
1765
# File 'lib/oci8/metadata.rb', line 1763

def max_proc_len
  attr_get_ub4(OCI_ATTR_MAX_PROC_LEN)
end

#ncharset_idObject

database national language support character set Id



1752
1753
1754
# File 'lib/oci8/metadata.rb', line 1752

def ncharset_id
  attr_get_ub2(OCI_ATTR_NCHARSET_ID)
end

#ncharset_nameObject

database national language support character set name



1842
1843
1844
# File 'lib/oci8/metadata.rb', line 1842

def ncharset_name
  __charset_name(ncharset_id)
end

#nowait_supportObject

Does database support the nowait clause? Values are :nw_supported and :nw_unsupported



1811
1812
1813
1814
1815
1816
# File 'lib/oci8/metadata.rb', line 1811

def nowait_support
  case attr_get_ub1(OCI_ATTR_NOWAIT_SUPPORT)
  when 0; :nw_supported
  when 1; :nw_unsupported
  end
end

#savepoint_supportObject

Does database support savepoints? Values are :sp_supported and :sp_unsupported



1802
1803
1804
1805
1806
1807
# File 'lib/oci8/metadata.rb', line 1802

def savepoint_support
  case attr_get_ub1(OCI_ATTR_SAVEPOINT_SUPPORT)
  when 0; :sp_supported
  when 1; :sp_unsupported
  end
end

#schemasObject

array of Schema objects in the database



1847
1848
1849
# File 'lib/oci8/metadata.rb', line 1847

def schemas
  @schemas ||= list_schemas.to_a
end

#versionObject

database version



1742
1743
1744
# File 'lib/oci8/metadata.rb', line 1742

def version
  attr_get_string(OCI_ATTR_VERSION)
end