1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Adding custom data: GNOME Data Access 5 manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GNOME Data Access 5 manual">
<link rel="up" href="gda-dict.html" title="Dictionary - metadata">
<link rel="prev" href="gda-dict.html" title="Dictionary - metadata">
<link rel="next" href="information_schema.html" title="Database structure">
<meta name="generator" content="GTK-Doc V1.32 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="gda-dict.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gda-dict.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="information_schema.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="sect1">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="GdaMetaStoreCustomData"></a>Adding custom data</h2></div></div></div>
<p>
This section explains how to add application specific data (custom data) to a
GdaMetaStore object.
</p>
<p>
Applications of course don't need to use that feature to manage their own data but it makes sense to use
it if the application also uses metadata to avoid having to manipulate several files for the same "task".
</p>
<div class="sect3">
<div class="titlepage"><div><div><h4 class="title">
<a name="id-1.3.11.7.4"></a>Storing data as (key, value) pairs</h4></div></div></div>
<p>
In very simple cases, when the data to store is made of named values, the easiest way is to use the
<a class="link" href="GdaMetaStore.html#gda-meta-store-set-attribute-value" title="gda_meta_store_set_attribute_value ()">gda_meta_store_set_attribute_value()</a> and
<a class="link" href="GdaMetaStore.html#gda-meta-store-get-attribute-value" title="gda_meta_store_get_attribute_value ()">gda_meta_store_get_attribute_value()</a> methods
where the values are stored and retrieved as strings.
</p>
</div>
<div class="sect3">
<div class="titlepage"><div><div><h4 class="title">
<a name="id-1.3.11.7.5"></a>Declaring the new custom database objects</h4></div></div></div>
<p>
The <a class="link" href="GdaMetaStore.html#gda-meta-store-schema-add-custom-object" title="gda_meta_store_schema_add_custom_object ()">gda_meta_store_schema_add_custom_object()</a>
method canbe used to add custom objects, which have to be described using an XML syntax. The advantages
of using that method are:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>The object's definition will be the same for all database types</p></li>
<li class="listitem"><p>If another object with a different definition already exists, then a error is returned</p></li>
</ul></div>
<p>
</p>
</div>
<div class="sect3">
<div class="titlepage"><div><div><h4 class="title">
<a name="id-1.3.11.7.6"></a>Adding and removing data</h4></div></div></div>
<p>
For the moment adding and removing data must be done as for any other database connection,
using the GdaMetaStore's internal connection obtained
with gda_meta_store_get_internal_connection().
</p>
</div>
<div class="sect3">
<div class="titlepage"><div><div><h4 class="title">
<a name="id-1.3.11.7.7"></a>Removing custom database objects</h4></div></div></div>
<p>
For the moment adding and removing data must be done as for any other database connection,
using the GdaMetaStore's internal connection obtained
with gda_meta_store_get_internal_connection().
</p>
</div>
<p>
</p>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32</div>
</body>
</html>
|