Commit 823d5248 authored by Maciej Sobczak's avatar Maciej Sobczak

Added Ada language binding.

parent 0361be78
......@@ -25,6 +25,7 @@
<a href="reference.html">Client interface reference</a><br />
<a href="backends.html">Backends reference</a><br />
<a href="rationale.html">Rationale FAQ</a><br /><br />
<a href="languages/ada/index.html">Ada language binding</a><br /><br />
<a href="backends/index.html">Existing backends and supported platforms</a>
</div>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>SOCI-Ada - documentation</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<h1>SOCI-Ada - manual</h1>
<p class="section"><b>Concepts</b></p>
<p>
The SOCI-Ada library borrows its concepts and naming from the main SOCI project. They are shortly explained here in the bottom-up fashion.
</p>
<p>
One of the main properties of the library is that the data objects which are bound for transfer to and from the database server are managed by the library itself and are not directly visible from the user code. This ensures that no aliasing of objects occurs between Ada and underlying C++ code, which makes the inter-language interface easier and more resilient to the differences in how compilers handle the linkage. As a direct result of this design choice, users of SOCI-Ada need to instruct the library to internally create all objects that will be subject to data transfer.
</p>
<p>
There are two kinds of objects that can be managed by the SOCI-Ada library:
</p>
<ul>
<li><i>Into elements</i>, which are data objects that are transferred from the database to the user program as a result of executing a query. There are single into elements for binding single rows of results and vector into elements for binding whole bunches of data corresponding to whole result sets or their subranges. The into elements are identified by their <i>position</i>.</li>
<li><i>Use elements</i>, which are data objects that are transferred from the user program to the database as parameters of the query (and, if supported by the target database, that can be modified by the database server and transferred back to the user program). There are single use elements for binding parameters of single-row queries and vector use elements for binding whole bunches of data for transfer. The use elements are identified by their <i>name</i>.</li>
</ul>
<p>
The user program can read the current value of into and use elements and assign new values to use elements. Elements are strongly typed and the following types are currently supported:
</p>
<ul>
<li><code>String</code></li>
<li><code>SOCI.DB_Integer</code>, which is defined by the library in terms of <code>Interfaces.C.int</code></li>
<li><code>SOCI.DB_Long_Long_Integer</code>, which is defined in terms of <code>Interfaces.Integer_64</code></li>
<li><code>SOCI.DB_Long_Float</code>, which is defined in terms of <code>Interfaces.C.double</code></li>
<li><code>Ada.Calendar.Time</code></li>
</ul>
<p>
Both into and use elements are managed for a single <i>statement</i>, which can be prepared once and executed once or many times, with data transfer handled during execution or fetch phase.
</p>
<p>
Statements can be managed explicitly, which is required if they are to be used repeteadly or when data transfer is needed or implicitly, which is a shorthand notation that is particularly useful with simple queries or DDL commands.
</p>
<p>
All statements are handled within the context of some <i>session</i>, which also supports <i>transactions</i>.
</p>
<p>
Sessions can be managed in isolation or as a group called <i>connection pool</i>, which helps to decouple tasking design choices from the concurrency policies at the database connection level. Sessions are <i>leased</i> from the pool for some time during which no other task can access them and returned back when no longer needed, where they can be acquired again by other tasks.
</p>
<p>
All potential problems are signalled via exceptions that have some descriptive message attached to them.
</p>
<table class="foot-links" border="0" cellpadding="2" cellspacing="2">
<tr>
<td class="foot-link-left">
<a href="index.html">Back to index</a>
</td>
<td class="foot-link-right">
<a href="idioms.html">Common Idioms</a>
</td>
</tr>
</table>
<p class="copyright">Copyright &copy; 2008-2011 Maciej Sobczak</p>
</body>
</html>
This diff is collapsed.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>SOCI-Ada Language Binding - documentation</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<h1>SOCI-Ada Language Binding - documentation</h1>
<p>
<a href="#introduction">Introduction</a><br />
<a href="#compilation">Compilation</a><br />
<a href="concepts.html">Concepts</a><br />
<a href="idioms.html">Common Idioms</a><br />
<a href="reference.html">API Reference</a><br />
</p>
<hr />
<p class="section"><a name="introduction" /><b>Introduction</b></p>
<p>
SOCI-Ada is a database access library for Ada.
</p>
<p>
The library itself is a wrapper for the selected functionality of the SOCI library, which is a C++ database access library recognized for its high quality and innovative interface.
</p>
<p>
The SOCI-Ada library offers the following features to the Ada community:
</p>
<ul>
<li>Modular design based on dynamic backend loading. Thanks to this feature, new backends implemented within the context of the main SOCI project are immediately available for Ada programmers without any additional work. A large community of C++ users can help ensure that the new backends are well tested in a variety of environments and usage scenarios.</li>
<li>Native backends for major database servers ensure optimal performance and minimize configuration overhead and complexity that is usually associated with other database access methods.</li>
<li>Direct support for bulk operations allow to achieve high performance with queries that operate on large data sets.</li>
<li>Very liberal open-source license (<a href="http://www.opensource.org/licenses/bsl1.0.html" target="_blank">Boost, accepted by Open Source Initiative</a>) that encourages both commercial and non-commercial use.</li>
<li>Easy to use and compact interface.</li>
</ul>
<p>
Currently the following database servers are directly supported via their native interfaces:
</p>
<ul>
<li>Oracle</li>
<li>PostgreSQL</li>
<li>MySQL</li>
</ul>
<p>
Other backends exist in the SOCI Git repository and can be provided with future version of the library.
</p>
<p class="section"><a name="compilation" /><b>Compilation</b></p>
<p>
In order to use SOCI-Ada, compile the C++ parts first (core and required backends).
</p>
<p>
<b>Note:</b> SOCI header files are not needed to use SOCI-Ada, only compiled SOCI libraries (core and relevant backend) need to exist to build and use SOCI-Ada programs.
</p>
<p>
The SOCI-Ada library itself is a single package named
<code>SOCI</code>. This package can be just imported in the target project as is or pre-built to the binary form if required.
</p>
<p>
In order to link the user programs the <code>-lsoci_core -lstdc++</code> linker options need to be provided on the Unix/Linux platforms.
</p>
<table class="foot-links" border="0" cellpadding="2" cellspacing="2">
<tr>
<td class="foot-link-left">
</td>
<td class="foot-link-right">
<a href="concepts.html">Concepts</a>
</td>
</tr>
</table>
<p class="copyright">Copyright &copy; 2008-2011 Maciej Sobczak</p>
</body>
</html>
This diff is collapsed.
body
{
background-color: white;
color: black;
margin-left: 100px;
margin-right: 100px;
font-family: arial, sans-serif;
font-size: small;
}
div.note
{
border-color: black;
border-style: dotted;
border-width: 1px;
margin-top: 20px;
padding-left: 20px;
padding-right: 20px;
}
span.note
{
font-size: large;
font-weight: bold;
}
code
{
/* font-weight: bold; */
background-color: white;
color: #8B0000;
/* font-size: large; */
}
pre.example
{
background-color: #F0F0F0;
color: black;
border-width: 1px;
border-style: dashed;
border-color: blue;
padding: 10px 10px 10px 10px;
}
table.foot-links
{
width: 100%;
padding-top: 20px;
}
td.foot-link-left
{
text-align: left;
}
td.foot-link-right
{
text-align: right;
}
p.copyright
{
border-top-color: black;
border-top-style: solid;
border-top-width: 1px;
padding-top: 5px;
}
-- Copyright (C) 2008-2011 Maciej Sobczak
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
package SOCI.MySQL is
pragma Pure;
--
-- Registers the MySQL backend so that it is ready for use
-- by the dynamic backend loader.
--
procedure Register_Factory_MySQL;
pragma Import (C, Register_Factory_MySQL,
"register_factory_mysql");
end SOCI.MySQL;
-- Copyright (C) 2008-2011 Maciej Sobczak
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
package SOCI.Oracle is
pragma Pure;
--
-- Registers the Oracle backend so that it is ready for use
-- by the dynamic backend loader.
--
procedure Register_Factory_Oracle;
pragma Import (C, Register_Factory_Oracle,
"register_factory_oracle");
end SOCI.Oracle;
-- Copyright (C) 2008-2011 Maciej Sobczak
-- Distributed under the Boost Software License, Version 1.0.
-- (See accompanying file LICENSE_1_0.txt or copy at
-- http://www.boost.org/LICENSE_1_0.txt)
package SOCI.PostgreSQL is
pragma Pure;
--
-- Registers the PostgreSQL backend so that it is ready for use
-- by the dynamic backend loader.
--
procedure Register_Factory_PostgreSQL;
pragma Import (C, Register_Factory_PostgreSQL,
"register_factory_postgresql");
end SOCI.PostgreSQL;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment