MetaStore.schemaAddCustomObject

The internal database used by store can be 'augmented' with some user-defined database objects (such as tables or views). This method allows one to add a new database object.

If the internal database already contains the object, then: <itemizedlist> <listitem><para>if the object is equal to the provided description then TRUE is returned</para></listitem> <listitem><para>if the object exists but differs from the provided description, then FALSE is returned, with the GDA_META_STORE_SCHEMA_OBJECT_CONFLICT_ERROR error code</para></listitem> </itemizedlist>

The xml_description defines the table of view's definition, for example: <programlisting><![CDATA[<table name="mytable"> <column name="id" pkey="TRUE"/> <column name="value"/> </table>]]></programlisting>

The partial DTD for this XML description of the object to add is the following (the top node must be a &lt;table&gt; or a &lt;view&gt;): <programlisting><![CDATA[<!ELEMENT table (column*,check*,fkey*,unique*)> <!ATTLIST table name NMTOKEN #REQUIRED>

<!ELEMENT column EMPTY> <!ATTLIST column name NMTOKEN #REQUIRED type CDATA #IMPLIED pkey (TRUE|FALSE) #IMPLIED autoinc (TRUE|FALSE) #IMPLIED nullok (TRUE|FALSE) #IMPLIED>

<!ELEMENT check (#PCDATA)>

<!ELEMENT fkey (part+)> <!ATTLIST fkey ref_table NMTOKEN #REQUIRED>

<!ELEMENT part EMPTY> <!ATTLIST part column NMTOKEN #IMPLIED ref_column NMTOKEN #IMPLIED>

<!ELEMENT unique (column)>

<!ELEMENT view (definition)> <!ATTLIST view name NMTOKEN #REQUIRED descr CDATA #IMPLIED>

<!ELEMENT definition (#PCDATA)>]]></programlisting>

class MetaStore
bool
schemaAddCustomObject

Parameters

xmlDescription string

an XML description of the table or view to add to store

Return Value

Type: bool

TRUE if the new object has successfully been added

Throws