[libgda] More documentation for Classes and Table class in GdaData.
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] More documentation for Classes and Table class in GdaData.
- Date: Thu, 29 Mar 2012 06:49:13 +0000 (UTC)
commit cf28be7289952152893f0c57fb8f127684007bbb
Author: Daniel Espinosa <despinosa src gnome org>
Date: Wed Mar 28 16:58:29 2012 -0600
More documentation for Classes and Table class in GdaData.
doc/mallard/gda-data/Classes.page | 9 ++++++---
doc/mallard/gda-data/Table-Class.page | 21 ++++++++++++++++++++-
2 files changed, 26 insertions(+), 4 deletions(-)
---
diff --git a/doc/mallard/gda-data/Classes.page b/doc/mallard/gda-data/Classes.page
index e72e55b..fd54325 100644
--- a/doc/mallard/gda-data/Classes.page
+++ b/doc/mallard/gda-data/Classes.page
@@ -2,7 +2,7 @@
type="topic" id="classes">
<info>
- <revision pkgversion="5.2" version="0.1" date="2012-01-18" status="incomplete" />
+ <revision pkgversion="5.2" version="0.1" date="2012-03-28" status="incomplete" />
<credit type="author">
<name>Daniel Espinosa</name>
<email>despinosa src gnome org</email>
@@ -20,11 +20,14 @@
GDA's Vala Extensions classes are instantiable. They implement generic interfaces. Use GDA's Vala bindings to get access to database's data.
</p>
<p>
- They load in memory all required data from database when <code>update()</code> method is called; but you are able to set data without call it and then use <code>save()</code> method to set it to the database. Methods <code>update()</code> and <code>save()</code> execute SQL commands directly using GDA's database providers.
+ They load in memory all required data from database when <code>update()</code> method is called; but you are able to set data without call it and then use <code>save()</code> method to update the database. Methods <code>update()</code> and <code>save()</code> execute SQL commands directly using GDA's database providers.
</p>
+ <p>
+ To create new database objects just setup them and then call <code>append()</code>. To delete it use <code>drop()</code>.
+ </p>.
<figure>
<title>UML diagram for Classes</title>
<desc>This diagram describes the available classes, its relations and interface implementations.</desc>
<media type="image" mime="image/png" src="classes-uml.png"/>
-</figure>
+ </figure>
</page>
diff --git a/doc/mallard/gda-data/Table-Class.page b/doc/mallard/gda-data/Table-Class.page
index d7f365c..5fc66d9 100644
--- a/doc/mallard/gda-data/Table-Class.page
+++ b/doc/mallard/gda-data/Table-Class.page
@@ -97,6 +97,22 @@
If the column will refer to a column in other table as a foreign key you must set <code>DbFieldInfo.fkey</code>. ForeignKey object is used for column's foreign keys.
</p>
</section>
+ <section>
+ <title>Deleting tables</title>
+ <p>
+ If you want to delete a table you must create a new <code>Table</code> object, set a name and a <code>Gda.Connection</code>; finally you just call <code>Table.drop()</code> method.
+ </p>
+ <listing>
+ <title>Dropping a table. Example </title>
+ <desc>This code describes how to delete a table in a database</desc>
+ <code>
+ var t = new Table ();
+ t.name = "table_name";
+ t.connection = connection;
+ t.drop ();
+ </code>
+ </listing>
+ </section>
<section id="table-fields">
<title>Iterating through Fields definitions</title>
<p>
@@ -129,10 +145,13 @@
</section>
<section id="table-dependencies">
<title>Table's dependencies</title>
+ <p>
+ In order to introspect a database table, you must create a new <code>Table</code> object, set a name and a <code>Gda.Connection</code>, then call <code>Table.update()</code>. After this you are able to know its dependencies.
+ </p>
<section id="table-dependencies-depends">
<title>ForeignKeys</title>
<p>
- When you call <code>Table.update()</code>, you can access to all <code>DbTable</code> objects referenced in foreign keys for each column in the table definition, using <code>Table.depends</code>, through a <code>Gee.Collection</code> of <code>DbTable</code> objects.
+You can access to all <code>DbTable</code> objects referenced in foreign keys for each column in the table definition, using <code>Table.depends</code>, through a <code>Gee.Collection</code> of <code>DbTable</code> objects.
</p>
</section>
<section id="table-dependencies-referenced">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]