mirror of
https://gitea.invidious.io/iv-org/shard-crystal-db.git
synced 2024-08-15 00:53:32 +00:00
publishing docs for 0.4.4
This commit is contained in:
parent
c8e902a3ac
commit
9c4b4a494b
39 changed files with 17047 additions and 0 deletions
707
api/0.4.4/DB.html
Normal file
707
api/0.4.4/DB.html
Normal file
|
@ -0,0 +1,707 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="js/doc.js"></script>
|
||||
<title>DB - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">module</span> DB
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>The DB module is a unified interface to database access.
|
||||
Database dialects is supported by custom database driver shards.
|
||||
Check <a href="https://github.com/crystal-lang/crystal-sqlite3" target="_blank">crystal-lang/crystal-sqlite3</a> for example.</p>
|
||||
|
||||
<p>Drivers implementors check <code><a href="DB/Driver.html">Driver</a></code> class.</p>
|
||||
|
||||
<p>DB manage a connection pool. The connection pool can be configured by <code>URI</code> query. See <code><a href="DB/Database.html">Database</a></code>.</p>
|
||||
|
||||
<h3>Usage</h3>
|
||||
|
||||
<p>Assuming <code>crystal-sqlite3</code> is included a sqlite3 database can be opened with <code><a href="DB.html#open%28uri%3AURI%7CString%29-class-method">#open</a></code>.</p>
|
||||
|
||||
<pre><code>db <span class="o">=</span> <span class="t">DB</span>.open <span class="s">"sqlite3:./path/to/db/file.db"</span>
|
||||
db.close</code></pre>
|
||||
|
||||
<p>If a block is given to <code><a href="DB.html#open%28uri%3AURI%7CString%29-class-method">#open</a></code> the database is closed automatically</p>
|
||||
|
||||
<pre><code><span class="t">DB</span>.open <span class="s">"sqlite3:./file.db"</span> <span class="k">do</span> <span class="o">|</span>db<span class="o">|</span>
|
||||
<span class="c"># work with db</span>
|
||||
<span class="k">end</span> <span class="c"># db is closed</span></code></pre>
|
||||
|
||||
<p>In the code above <code>db</code> is a <code><a href="DB/Database.html">Database</a></code>. Methods available for querying it are described in <code><a href="DB/QueryMethods.html">QueryMethods</a></code>.</p>
|
||||
|
||||
<p>Three kind of statements can be performed:</p>
|
||||
|
||||
<ol><li><code>Database#exec</code> waits no response from the database.</li><li><code>Database#scalar</code> reads a single value of the response.</li><li><code>Database#query</code> returns a ResultSet that allows iteration over the rows in the response and column information.</li></ol>
|
||||
|
||||
<p>All of the above methods allows parametrised query. Either positional or named arguments.</p>
|
||||
|
||||
<p>Check a full working version:</p>
|
||||
|
||||
<pre><code><span class="k">require</span> <span class="s">"db"</span>
|
||||
<span class="k">require</span> <span class="s">"sqlite3"</span>
|
||||
|
||||
<span class="t">DB</span>.open <span class="s">"sqlite3:./file.db"</span> <span class="k">do</span> <span class="o">|</span>db<span class="o">|</span>
|
||||
db.exec <span class="s">"create table contacts (name text, age integer)"</span>
|
||||
db.exec <span class="s">"insert into contacts values (?, ?)"</span>, <span class="s">"John Doe"</span>, <span class="n">30</span>
|
||||
|
||||
args <span class="o">=</span> <span class="o">[]</span> <span class="k">of</span> <span class="t">DB</span><span class="t">::</span><span class="t">Any</span>
|
||||
args <span class="o"><<</span> <span class="s">"Sarah"</span>
|
||||
args <span class="o"><<</span> <span class="n">33</span>
|
||||
db.exec <span class="s">"insert into contacts values (?, ?)"</span>, args
|
||||
|
||||
puts <span class="s">"max age:"</span>
|
||||
puts db.scalar <span class="s">"select max(age) from contacts"</span> <span class="c"># => 33</span>
|
||||
|
||||
puts <span class="s">"contacts:"</span>
|
||||
db.query <span class="s">"select name, age from contacts order by age desc"</span> <span class="k">do</span> <span class="o">|</span>rs<span class="o">|</span>
|
||||
puts <span class="s">"</span><span class="i">#{</span></span>rs.column_name(<span class="n">0</span>)<span class="s"><span class="i">}</span> (</span><span class="i">#{</span></span>rs.column_name(<span class="n">1</span>)<span class="s"><span class="i">}</span>)"</span>
|
||||
<span class="c"># => name (age)</span>
|
||||
rs.each <span class="k">do</span>
|
||||
puts <span class="s">"</span><span class="i">#{</span></span>rs.read(<span class="t">String</span>)<span class="s"><span class="i">}</span> (</span><span class="i">#{</span></span>rs.read(<span class="t">Int32</span>)<span class="s"><span class="i">}</span>)"</span>
|
||||
<span class="c"># => Sarah (33)</span>
|
||||
<span class="c"># => John Doe (30)</span>
|
||||
<span class="k">end</span>
|
||||
<span class="k">end</span>
|
||||
<span class="k">end</span></code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db.cr#L68" target="_blank">db.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L3" target="_blank">db/pool.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/string_key_cache.cr#L1" target="_blank">db/string_key_cache.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L1" target="_blank">db/query_methods.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L1" target="_blank">db/session_methods.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/disposable.cr#L1" target="_blank">db/disposable.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/driver.cr#L1" target="_blank">db/driver.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L1" target="_blank">db/statement.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/begin_transaction.cr#L1" target="_blank">db/begin_transaction.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/connection_context.cr#L1" target="_blank">db/connection_context.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/connection.cr#L1" target="_blank">db/connection.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L1" target="_blank">db/transaction.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_statement.cr#L1" target="_blank">db/pool_statement.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/database.cr#L4" target="_blank">db/database.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_prepared_statement.cr#L1" target="_blank">db/pool_prepared_statement.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_unprepared_statement.cr#L1" target="_blank">db/pool_unprepared_statement.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L1" target="_blank">db/result_set.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/error.cr#L1" target="_blank">db/error.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/mapping.cr#L1" target="_blank">db/mapping.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L9" target="_blank">spec.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/version.cr#L1" target="_blank">db/version.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constant Summary</h2>
|
||||
|
||||
<dl>
|
||||
|
||||
<dt class="entry-const" id="TYPES">
|
||||
<strong>TYPES</strong> = <code>[<span class="t">Nil</span>, <span class="t">String</span>, <span class="t">Bool</span>, <span class="t">Int32</span>, <span class="t">Int64</span>, <span class="t">Float32</span>, <span class="t">Float64</span>, <span class="t">Time</span>, <span class="t">Bytes</span>]</code>
|
||||
</dt>
|
||||
|
||||
<dd class="entry-const-doc">
|
||||
<p>Types supported to interface with database driver.
|
||||
These can be used in any <code><a href="DB/ResultSet.html#read-instance-method">ResultSet#read</a></code> or any <code>Database#query</code> related
|
||||
method to be used as query parameters</p>
|
||||
</dd>
|
||||
|
||||
|
||||
<dt class="entry-const" id="VERSION">
|
||||
<strong>VERSION</strong> = <code><span class="s">"0.4.4"</span></code>
|
||||
</dt>
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Class Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#connect%28uri%3AURI%7CString%29-class-method" class="signature"><strong>.connect</strong>(uri : URI | String)</a>
|
||||
|
||||
<div class="summary"><p>Opens a connection using the specified <em>uri</em>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#connect%28uri%3AURI%7CString%2C%26block%29-class-method" class="signature"><strong>.connect</strong>(uri : URI | String, &block)</a>
|
||||
|
||||
<div class="summary"><p>Opens a connection using the specified <em>uri</em>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#open%28uri%3AURI%7CString%29-class-method" class="signature"><strong>.open</strong>(uri : URI | String)</a>
|
||||
|
||||
<div class="summary"><p>Opens a database using the specified <em>uri</em>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#open%28uri%3AURI%7CString%2C%26block%29-class-method" class="signature"><strong>.open</strong>(uri : URI | String, &block)</a>
|
||||
|
||||
<div class="summary"><p>Same as <code><a href="DB.html#open%28uri%3AURI%7CString%29-class-method">#open</a></code> but the database is yielded and closed automatically.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#register_driver%28driver_name%2Cdriver_class%3ADriver.class%29-class-method" class="signature"><strong>.register_driver</strong>(driver_name, driver_class : Driver.class)</a>
|
||||
|
||||
<div class="summary"><p>Registers a driver class for a given <em>driver_name</em>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Macro Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#mapping%28properties%2Cstrict%3Dtrue%29-macro" class="signature"><strong>mapping</strong>(properties, strict = true)</a>
|
||||
|
||||
<div class="summary"><p>The <code><a href="DB.html#mapping-macro">DB.mapping</a></code> macro defines how an object is built from a DB::ResultSet.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#mapping-macro" class="signature"><strong>mapping</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Class Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="connect(uri:URI|String)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>connect</strong>(uri : URI | String)
|
||||
|
||||
<a class="method-permalink" href="#connect%28uri%3AURI%7CString%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Opens a connection using the specified <em>uri</em>.
|
||||
The scheme of the <em>uri</em> determines the driver to use.
|
||||
Returned connection must be closed by <code>Connection#close</code>.
|
||||
If a block is used the connection is yielded and closed automatically.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db.cr#L120" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="connect(uri:URI|String,&block)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>connect</strong>(uri : URI | String, &block)
|
||||
|
||||
<a class="method-permalink" href="#connect%28uri%3AURI%7CString%2C%26block%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Opens a connection using the specified <em>uri</em>.
|
||||
The scheme of the <em>uri</em> determines the driver to use.
|
||||
Returned connection must be closed by <code>Connection#close</code>.
|
||||
If a block is used the connection is yielded and closed automatically.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db.cr#L125" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="open(uri:URI|String)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>open</strong>(uri : URI | String)
|
||||
|
||||
<a class="method-permalink" href="#open%28uri%3AURI%7CString%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Opens a database using the specified <em>uri</em>.
|
||||
The scheme of the <em>uri</em> determines the driver to use.
|
||||
Returned database must be closed by <code><a href="DB/Database.html#close-instance-method">Database#close</a></code>.
|
||||
If a block is used the database is yielded and closed automatically.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db.cr#L102" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="open(uri:URI|String,&block)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>open</strong>(uri : URI | String, &block)
|
||||
|
||||
<a class="method-permalink" href="#open%28uri%3AURI%7CString%2C%26block%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Same as <code><a href="DB.html#open%28uri%3AURI%7CString%29-class-method">#open</a></code> but the database is yielded and closed automatically.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db.cr#L107" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="register_driver(driver_name,driver_class:Driver.class)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>register_driver</strong>(driver_name, driver_class : Driver.class)
|
||||
|
||||
<a class="method-permalink" href="#register_driver%28driver_name%2Cdriver_class%3ADriver.class%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Registers a driver class for a given <em>driver_name</em>.
|
||||
Should be called by drivers implementors only.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db.cr#L90" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Macro Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="mapping(properties,strict=true)-macro">
|
||||
<div class="signature">
|
||||
|
||||
macro <strong>mapping</strong>(properties, strict = true)
|
||||
|
||||
<a class="method-permalink" href="#mapping%28properties%2Cstrict%3Dtrue%29-macro">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>The <code><a href="DB.html#mapping-macro">DB.mapping</a></code> macro defines how an object is built from a DB::ResultSet.</p>
|
||||
|
||||
<p>It takes hash literal as argument, in which attributes and types are defined.
|
||||
Once defined, <code><a href="DB/ResultSet.html#read%28type%3ADB%3A%3AMappable.class%29-instance-method">DB::ResultSet#read(t)</a></code> populates properties of the class from the
|
||||
result set.</p>
|
||||
|
||||
<pre><code class='language-crystal'><span class="k">require</span> <span class="s">"db"</span>
|
||||
|
||||
<span class="k">class</span> <span class="t">Employee</span>
|
||||
<span class="t">DB</span>.mapping({
|
||||
title: <span class="t">String</span>,
|
||||
name: <span class="t">String</span>,
|
||||
})
|
||||
<span class="k">end</span>
|
||||
|
||||
employees <span class="o">=</span> <span class="t">Employee</span>.from_rs(db.query(<span class="s">"SELECT title, name FROM employees"</span>))
|
||||
employees[<span class="n">0</span>].title <span class="c"># => "Manager"</span>
|
||||
employees[<span class="n">0</span>].name <span class="c"># => "John"</span></code></pre>
|
||||
|
||||
<p>Attributes not mapped with <code><a href="DB.html#mapping-macro">DB.mapping</a></code> are not defined as properties.
|
||||
Also, missing attributes raise a <code>DB::Exception</code>.</p>
|
||||
|
||||
<p>You can also define attributes for each property.</p>
|
||||
|
||||
<pre><code class='language-crystal'><span class="k">class</span> <span class="t">Employee</span>
|
||||
<span class="t">DB</span>.mapping({
|
||||
title: <span class="t">String</span>,
|
||||
name: {
|
||||
<span class="k">type</span>: <span class="t">String</span>,
|
||||
nilable: <span class="n">true</span>,
|
||||
key: <span class="s">"firstname"</span>,
|
||||
},
|
||||
})
|
||||
<span class="k">end</span></code></pre>
|
||||
|
||||
<p>Available attributes:</p>
|
||||
|
||||
<ul><li><em>type</em> (required) defines its type. In the example above, <em>title: String</em> is a shortcut to <em>title: {type: String}</em>.</li><li><em>nilable</em> defines if a property can be a <code>Nil</code>.</li><li><strong>default</strong>: value to use if the property is missing in the result set, or if it's <code>null</code> and <code>nilable</code> was not set to <code>true</code>. If the default value creates a new instance of an object (for example <code>[1, 2, 3]</code> or <code>SomeObject.new</code>), a different instance will be used each time a row is parsed.</li><li><em>key</em> defines which column to read from a reusltset. It defaults to the name of the property.</li><li><em>converter</em> takes an alternate type for parsing. It requires a <code>#from_rs</code> method in that class, and returns an instance of the given type.</li></ul>
|
||||
|
||||
<p>The mapping also automatically defines Crystal properties (getters and setters) for each
|
||||
of the keys. It doesn't define a constructor accepting those arguments, but you can provide
|
||||
an overload.</p>
|
||||
|
||||
<p>The macro basically defines a constructor accepting a <code><a href="DB/ResultSet.html">DB::ResultSet</a></code> that reads from
|
||||
it and initializes this type's instance variables.</p>
|
||||
|
||||
<p>This macro also declares instance variables of the types given in the mapping.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/mapping.cr#L60" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="mapping-macro">
|
||||
<div class="signature">
|
||||
|
||||
macro <strong>mapping</strong>
|
||||
|
||||
<a class="method-permalink" href="#mapping-macro">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/mapping.cr#L151" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
284
api/0.4.4/DB/Any.html
Normal file
284
api/0.4.4/DB/Any.html
Normal file
|
@ -0,0 +1,284 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::Any - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">alias</span> DB::Any
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Alias Definition</h2>
|
||||
<code>Bool | Float32 | Float64 | Int32 | Int64 | Slice(UInt8) | String | Time | Nil</code>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db.cr#L75" target="_blank">db.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
355
api/0.4.4/DB/BeginTransaction.html
Normal file
355
api/0.4.4/DB/BeginTransaction.html
Normal file
|
@ -0,0 +1,355 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::BeginTransaction - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">module</span> DB::BeginTransaction
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Direct including types</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/Connection.html">DB::Connection</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/Transaction.html">DB::Transaction</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/begin_transaction.cr#L2" target="_blank">db/begin_transaction.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#begin_transaction%3ATransaction-instance-method" class="signature"><strong>#begin_transaction</strong> : Transaction</a>
|
||||
|
||||
<div class="summary"><p>Creates a transaction from the current context.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#transaction%28%26block%29-instance-method" class="signature"><strong>#transaction</strong>(&block)</a>
|
||||
|
||||
<div class="summary"><p>yields a transaction from the current context.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="begin_transaction:Transaction-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>begin_transaction</strong> : <a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
<a class="method-permalink" href="#begin_transaction%3ATransaction-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Creates a transaction from the current context.
|
||||
If is expected that either <code><a href="../DB/Transaction.html#commit-instance-method">Transaction#commit</a></code> or <code><a href="../DB/Transaction.html#rollback-instance-method">Transaction#rollback</a></code>
|
||||
are called explictly to release the context.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/begin_transaction.cr#L6" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="transaction(&block)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>transaction</strong>(&block)
|
||||
|
||||
<a class="method-permalink" href="#transaction%28%26block%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>yields a transaction from the current context.
|
||||
Query the database through <code><a href="../DB/Transaction.html#connection%3AConnection-instance-method">Transaction#connection</a></code> object.
|
||||
If an exception is thrown within the block a rollback is performed.
|
||||
The exception thrown is blubbled unless it is a <code><a href="../DB/Rollback.html">DB::Rollback</a></code>.
|
||||
From the yielded object <code><a href="../DB/Transaction.html#commit-instance-method">Transaction#commit</a></code> or <code><a href="../DB/Transaction.html#rollback-instance-method">Transaction#rollback</a></code>
|
||||
can be called explicitly.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/begin_transaction.cr#L14" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
582
api/0.4.4/DB/Connection.html
Normal file
582
api/0.4.4/DB/Connection.html
Normal file
|
@ -0,0 +1,582 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::Connection - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">abstract class</span> DB::Connection
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/Connection.html">DB::Connection</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Database driver implementors must subclass <code><a href="../DB/Connection.html">Connection</a></code>.</p>
|
||||
|
||||
<p>Represents one active connection to a database.</p>
|
||||
|
||||
<p>Users should never instantiate a <code><a href="../DB/Connection.html">Connection</a></code> manually. Use <code><a href="../DB.html#open%28uri%3AURI%7CString%29-class-method">DB#open</a></code> or <code>Database#connection</code>.</p>
|
||||
|
||||
<p>Refer to <code><a href="../DB/QueryMethods.html">QueryMethods</a></code> for documentation about querying the database through this connection.</p>
|
||||
|
||||
<h3>Note to implementors</h3>
|
||||
|
||||
<p>The connection must be initialized in <code>#initialize</code> and closed in <code>#do_close</code>.</p>
|
||||
|
||||
<p>Override <code>#build_prepared_statement</code> method in order to return a prepared <code><a href="../DB/Statement.html">Statement</a></code> to allow querying.
|
||||
Override <code>#build_unprepared_statement</code> method in order to return a unprepared <code><a href="../DB/Statement.html">Statement</a></code> to allow querying.
|
||||
See also <code><a href="../DB/Statement.html">Statement</a></code> to define how the statements are executed.</p>
|
||||
|
||||
<p>If at any give moment the connection is lost a DB::ConnectionLost should be raised. This will
|
||||
allow the connection pool to try to reconnect or use another connection if available.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Included Modules</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/BeginTransaction.html">DB::BeginTransaction</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/Disposable.html">DB::Disposable</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/SessionMethods.html">DB::SessionMethods</a>(<a href="../DB/Connection.html">DB::Connection</a>, <a href="../DB/Statement.html">DB::Statement</a>)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/connection.cr#L21" target="_blank">db/connection.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28context%3AConnectionContext%29-class-method" class="signature"><strong>.new</strong>(context : ConnectionContext)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#begin_transaction-instance-method" class="signature"><strong>#begin_transaction</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#prepared_statements%3F%3ABool-instance-method" class="signature"><strong>#prepared_statements?</strong> : Bool</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#release-instance-method" class="signature"><strong>#release</strong></a>
|
||||
|
||||
<div class="summary"><p>return this connection to the pool managed by the database.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/BeginTransaction.html">DB::BeginTransaction</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/BeginTransaction.html#begin_transaction%3ATransaction-instance-method" class="tooltip">
|
||||
<span>begin_transaction : Transaction</span>
|
||||
begin_transaction</a>,
|
||||
|
||||
|
||||
<a href="../DB/BeginTransaction.html#transaction%28%26block%29-instance-method" class="tooltip">
|
||||
<span>transaction(&block)</span>
|
||||
transaction</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/SessionMethods.html">DB::SessionMethods</a>(<a href="../DB/Connection.html">DB::Connection</a>, <a href="../DB/Statement.html">DB::Statement</a>)</code></h3>
|
||||
|
||||
|
||||
<a href="../DB/SessionMethods.html#build%28query%29%3AStmt-instance-method" class="tooltip">
|
||||
<span>build(query) : Stmt</span>
|
||||
build</a>,
|
||||
|
||||
|
||||
<a href="../DB/SessionMethods.html#build_unprepared_statement%28query%29%3AStmt-instance-method" class="tooltip">
|
||||
<span>build_unprepared_statement(query) : Stmt</span>
|
||||
build_unprepared_statement</a>,
|
||||
|
||||
|
||||
<a href="../DB/SessionMethods.html#fetch_or_build_prepared_statement%28query%29%3AStmt-instance-method" class="tooltip">
|
||||
<span>fetch_or_build_prepared_statement(query) : Stmt</span>
|
||||
fetch_or_build_prepared_statement</a>,
|
||||
|
||||
|
||||
<a href="../DB/SessionMethods.html#prepared%28query%29-instance-method" class="tooltip">
|
||||
<span>prepared(query)<br/>prepared</span>
|
||||
prepared</a>,
|
||||
|
||||
|
||||
<a href="../DB/SessionMethods.html#prepared_statements%3F%3ABool-instance-method" class="tooltip">
|
||||
<span>prepared_statements? : Bool</span>
|
||||
prepared_statements?</a>,
|
||||
|
||||
|
||||
<a href="../DB/SessionMethods.html#unprepared%28query%29-instance-method" class="tooltip">
|
||||
<span>unprepared(query)<br/>unprepared</span>
|
||||
unprepared</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/QueryMethods.html">DB::QueryMethods</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>exec(query, *args)</span>
|
||||
exec</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>query(query, *args)<br/>query(query, *args, &block)</span>
|
||||
query</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query_all%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="tooltip">
|
||||
<span>query_all(query, *args, as type : Class)<br/>query_all(query, *args, as types : NamedTuple)<br/>query_all(query, *args, &block : ResultSet -> U) : Array(U) forall U<br/>query_all(query, *args, as types : Tuple)</span>
|
||||
query_all</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query_each%28query%2C%2Aargs%2C%26block%29-instance-method" class="tooltip">
|
||||
<span>query_each(query, *args, &block)</span>
|
||||
query_each</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query_one%28query%2C%2Aargs%2C%26block%3AResultSet-%3EU%29%3AUforallU-instance-method" class="tooltip">
|
||||
<span>query_one(query, *args, &block : ResultSet -> U) : U forall U<br/>query_one(query, *args, as types : Tuple)<br/>query_one(query, *args, as types : NamedTuple)<br/>query_one(query, *args, as type : Class)</span>
|
||||
query_one</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query_one%3F%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="tooltip">
|
||||
<span>query_one?(query, *args, as type : Class)<br/>query_one?(query, *args, as types : NamedTuple)<br/>query_one?(query, *args, as types : Tuple)<br/>query_one?(query, *args, &block : ResultSet -> U) : U? forall U</span>
|
||||
query_one?</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#scalar%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>scalar(query, *args)</span>
|
||||
scalar</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/Disposable.html">DB::Disposable</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#close-instance-method" class="tooltip">
|
||||
<span>close</span>
|
||||
close</a>,
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#closed%3F-instance-method" class="tooltip">
|
||||
<span>closed?</span>
|
||||
closed?</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(context:ConnectionContext)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(context : <a href="../DB/ConnectionContext.html">ConnectionContext</a>)
|
||||
|
||||
<a class="method-permalink" href="#new%28context%3AConnectionContext%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/connection.cr#L34" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="begin_transaction-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>begin_transaction</strong>
|
||||
|
||||
<a class="method-permalink" href="#begin_transaction-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/connection.cr#L49" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="prepared_statements?:Bool-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>prepared_statements?</strong> : Bool
|
||||
|
||||
<a class="method-permalink" href="#prepared_statements%3F%3ABool-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/connection.cr#L30" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="release-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>release</strong>
|
||||
|
||||
<a class="method-permalink" href="#release-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>return this connection to the pool
|
||||
managed by the database. Should be used
|
||||
only if the connection was obtained by <code><a href="../DB/Database.html#checkout-instance-method">Database#checkout</a></code>.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/connection.cr#L77" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
398
api/0.4.4/DB/ConnectionContext.html
Normal file
398
api/0.4.4/DB/ConnectionContext.html
Normal file
|
@ -0,0 +1,398 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::ConnectionContext - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">module</span> DB::ConnectionContext
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Direct including types</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/Database.html">DB::Database</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/connection_context.cr#L2" target="_blank">db/connection_context.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#discard%28connection%3AConnection%29-instance-method" class="signature"><strong>#discard</strong>(connection : Connection)</a>
|
||||
|
||||
<div class="summary"><p>Indicates that the <em>connection</em> was permanently closed and should not be used in the future.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#prepared_statements%3F%3ABool-instance-method" class="signature"><strong>#prepared_statements?</strong> : Bool</a>
|
||||
|
||||
<div class="summary"><p>Return whether the statements should be prepared by default</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#release%28connection%3AConnection%29-instance-method" class="signature"><strong>#release</strong>(connection : Connection)</a>
|
||||
|
||||
<div class="summary"><p>Indicates that the <em>connection</em> is no longer needed and can be reused in the future.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#uri%3AURI-instance-method" class="signature"><strong>#uri</strong> : URI</a>
|
||||
|
||||
<div class="summary"><p>Returns the uri with the connection settings to the database</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="discard(connection:Connection)-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>discard</strong>(connection : <a href="../DB/Connection.html">Connection</a>)
|
||||
|
||||
<a class="method-permalink" href="#discard%28connection%3AConnection%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Indicates that the <em>connection</em> was permanently closed
|
||||
and should not be used in the future.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/connection_context.cr#L11" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="prepared_statements?:Bool-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>prepared_statements?</strong> : Bool
|
||||
|
||||
<a class="method-permalink" href="#prepared_statements%3F%3ABool-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Return whether the statements should be prepared by default</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/connection_context.cr#L7" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="release(connection:Connection)-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>release</strong>(connection : <a href="../DB/Connection.html">Connection</a>)
|
||||
|
||||
<a class="method-permalink" href="#release%28connection%3AConnection%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Indicates that the <em>connection</em> is no longer needed
|
||||
and can be reused in the future.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/connection_context.cr#L15" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="uri:URI-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>uri</strong> : URI
|
||||
|
||||
<a class="method-permalink" href="#uri%3AURI-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the uri with the connection settings to the database</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/connection_context.cr#L4" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
387
api/0.4.4/DB/ConnectionLost.html
Normal file
387
api/0.4.4/DB/ConnectionLost.html
Normal file
|
@ -0,0 +1,387 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::ConnectionLost - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::ConnectionLost
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/ConnectionLost.html">DB::ConnectionLost</a></li><li class="superclass"><a href="../DB/Error.html">DB::Error</a></li><li class="superclass">Exception</li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Raised when an established connection is lost
|
||||
probably due to socket/network issues.
|
||||
It is used by the connection pool retry logic.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/error.cr#L17" target="_blank">db/error.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28connection%29-class-method" class="signature"><strong>.new</strong>(connection)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#connection%3AConnection-instance-method" class="signature"><strong>#connection</strong> : Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(connection)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(connection)
|
||||
|
||||
<a class="method-permalink" href="#new%28connection%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/error.cr#L20" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="connection:Connection-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>connection</strong> : <a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
<a class="method-permalink" href="#connection%3AConnection-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/error.cr#L18" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
329
api/0.4.4/DB/ConnectionRefused.html
Normal file
329
api/0.4.4/DB/ConnectionRefused.html
Normal file
|
@ -0,0 +1,329 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::ConnectionRefused - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::ConnectionRefused
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/ConnectionRefused.html">DB::ConnectionRefused</a></li><li class="superclass"><a href="../DB/Error.html">DB::Error</a></li><li class="superclass">Exception</li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Raised when a connection is unable to be established
|
||||
probably due to socket/network or configuration issues.
|
||||
It is used by the connection pool retry logic.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/error.cr#L27" target="_blank">db/error.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
636
api/0.4.4/DB/Database.html
Normal file
636
api/0.4.4/DB/Database.html
Normal file
|
@ -0,0 +1,636 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::Database - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::Database
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/Database.html">DB::Database</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Acts as an entry point for database access.
|
||||
Connections are managed by a pool.
|
||||
The connection pool can be configured from URI parameters:</p>
|
||||
|
||||
<ul><li>initial_pool_size (default 1)</li><li>max_pool_size (default 0 = unlimited)</li><li>max_idle_pool_size (default 1)</li><li>checkout_timeout (default 5.0)</li><li>retry_attempts (default 1)</li><li>retry_delay (in seconds, default 1.0)</li></ul></ul>
|
||||
|
||||
<p>When querying a database prepared statements are used by default.
|
||||
This can be changed from the <code>prepared_statements</code> URI parameter:</p>
|
||||
|
||||
<ul><li>prepared_statements = <code>true</code>|<code>false</code> (default <code>true</code>)</li></ul></ul>
|
||||
|
||||
<p>It should be created from DB module. See <code><a href="../DB.html#open%28uri%3AURI%7CString%29-class-method">DB#open</a></code>.</p>
|
||||
|
||||
<p>Refer to <code><a href="../DB/QueryMethods.html">QueryMethods</a></code> and <code><a href="../DB/SessionMethods.html">SessionMethods</a></code> for documentation about querying the database.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Included Modules</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/ConnectionContext.html">DB::ConnectionContext</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/SessionMethods.html">DB::SessionMethods</a>(<a href="../DB/Database.html">DB::Database</a>, <a href="../DB/PoolStatement.html">DB::PoolStatement</a>)</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/database.cr#L24" target="_blank">db/database.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#checkout-instance-method" class="signature"><strong>#checkout</strong></a>
|
||||
|
||||
<div class="summary"><p>returns a connection from the pool the returned connection must be returned to the pool by explictly calling <code><a href="../DB/Connection.html#release-instance-method">Connection#release</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#close-instance-method" class="signature"><strong>#close</strong></a>
|
||||
|
||||
<div class="summary"><p>Closes all connection to the database.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#prepared_statements%3F%3ABool-instance-method" class="signature"><strong>#prepared_statements?</strong> : Bool</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#setup_connection%28%26proc%3AConnection-%3ENil%29-instance-method" class="signature"><strong>#setup_connection</strong>(&proc : Connection -> Nil)</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#transaction%28%26block%29-instance-method" class="signature"><strong>#transaction</strong>(&block)</a>
|
||||
|
||||
<div class="summary"><p>yields a <code><a href="../DB/Transaction.html">Transaction</a></code> from a connection of the pool Refer to <code><a href="../DB/BeginTransaction.html#transaction%28%26block%29-instance-method">BeginTransaction#transaction</a></code> for documentation.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#uri%3AURI-instance-method" class="signature"><strong>#uri</strong> : URI</a>
|
||||
|
||||
<div class="summary"><p>Returns the uri with the connection settings to the database</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#using_connection%28%26block%29-instance-method" class="signature"><strong>#using_connection</strong>(&block)</a>
|
||||
|
||||
<div class="summary"><p>yields a connection from the pool the connection is returned to the pool when the block ends</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/ConnectionContext.html">DB::ConnectionContext</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/ConnectionContext.html#discard%28connection%3AConnection%29-instance-method" class="tooltip">
|
||||
<span>discard(connection : Connection)</span>
|
||||
discard</a>,
|
||||
|
||||
|
||||
<a href="../DB/ConnectionContext.html#prepared_statements%3F%3ABool-instance-method" class="tooltip">
|
||||
<span>prepared_statements? : Bool</span>
|
||||
prepared_statements?</a>,
|
||||
|
||||
|
||||
<a href="../DB/ConnectionContext.html#release%28connection%3AConnection%29-instance-method" class="tooltip">
|
||||
<span>release(connection : Connection)</span>
|
||||
release</a>,
|
||||
|
||||
|
||||
<a href="../DB/ConnectionContext.html#uri%3AURI-instance-method" class="tooltip">
|
||||
<span>uri : URI</span>
|
||||
uri</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/SessionMethods.html">DB::SessionMethods</a>(<a href="../DB/Database.html">DB::Database</a>, <a href="../DB/PoolStatement.html">DB::PoolStatement</a>)</code></h3>
|
||||
|
||||
|
||||
<a href="../DB/SessionMethods.html#build%28query%29%3AStmt-instance-method" class="tooltip">
|
||||
<span>build(query) : Stmt</span>
|
||||
build</a>,
|
||||
|
||||
|
||||
<a href="../DB/SessionMethods.html#build_unprepared_statement%28query%29%3AStmt-instance-method" class="tooltip">
|
||||
<span>build_unprepared_statement(query) : Stmt</span>
|
||||
build_unprepared_statement</a>,
|
||||
|
||||
|
||||
<a href="../DB/SessionMethods.html#fetch_or_build_prepared_statement%28query%29%3AStmt-instance-method" class="tooltip">
|
||||
<span>fetch_or_build_prepared_statement(query) : Stmt</span>
|
||||
fetch_or_build_prepared_statement</a>,
|
||||
|
||||
|
||||
<a href="../DB/SessionMethods.html#prepared%28query%29-instance-method" class="tooltip">
|
||||
<span>prepared(query)<br/>prepared</span>
|
||||
prepared</a>,
|
||||
|
||||
|
||||
<a href="../DB/SessionMethods.html#prepared_statements%3F%3ABool-instance-method" class="tooltip">
|
||||
<span>prepared_statements? : Bool</span>
|
||||
prepared_statements?</a>,
|
||||
|
||||
|
||||
<a href="../DB/SessionMethods.html#unprepared%28query%29-instance-method" class="tooltip">
|
||||
<span>unprepared(query)<br/>unprepared</span>
|
||||
unprepared</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/QueryMethods.html">DB::QueryMethods</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>exec(query, *args)</span>
|
||||
exec</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>query(query, *args)<br/>query(query, *args, &block)</span>
|
||||
query</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query_all%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="tooltip">
|
||||
<span>query_all(query, *args, as type : Class)<br/>query_all(query, *args, as types : NamedTuple)<br/>query_all(query, *args, &block : ResultSet -> U) : Array(U) forall U<br/>query_all(query, *args, as types : Tuple)</span>
|
||||
query_all</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query_each%28query%2C%2Aargs%2C%26block%29-instance-method" class="tooltip">
|
||||
<span>query_each(query, *args, &block)</span>
|
||||
query_each</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query_one%28query%2C%2Aargs%2C%26block%3AResultSet-%3EU%29%3AUforallU-instance-method" class="tooltip">
|
||||
<span>query_one(query, *args, &block : ResultSet -> U) : U forall U<br/>query_one(query, *args, as types : Tuple)<br/>query_one(query, *args, as types : NamedTuple)<br/>query_one(query, *args, as type : Class)</span>
|
||||
query_one</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query_one%3F%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="tooltip">
|
||||
<span>query_one?(query, *args, as type : Class)<br/>query_one?(query, *args, as types : NamedTuple)<br/>query_one?(query, *args, as types : Tuple)<br/>query_one?(query, *args, &block : ResultSet -> U) : U? forall U</span>
|
||||
query_one?</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#scalar%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>scalar(query, *args)</span>
|
||||
scalar</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="checkout-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>checkout</strong>
|
||||
|
||||
<a class="method-permalink" href="#checkout-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>returns a connection from the pool
|
||||
the returned connection must be returned
|
||||
to the pool by explictly calling <code><a href="../DB/Connection.html#release-instance-method">Connection#release</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/database.cr#L117" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="close-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>close</strong>
|
||||
|
||||
<a class="method-permalink" href="#close-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Closes all connection to the database.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/database.cr#L65" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="prepared_statements?:Bool-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>prepared_statements?</strong> : Bool
|
||||
|
||||
<a class="method-permalink" href="#prepared_statements%3F%3ABool-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/database.cr#L36" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="setup_connection(&proc:Connection->Nil)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>setup_connection</strong>(&proc : <a href="../DB/Connection.html">Connection</a> -> Nil)
|
||||
|
||||
<a class="method-permalink" href="#setup_connection%28%26proc%3AConnection-%3ENil%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/database.cr#L57" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="transaction(&block)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>transaction</strong>(&block)
|
||||
|
||||
<a class="method-permalink" href="#transaction%28%26block%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>yields a <code><a href="../DB/Transaction.html">Transaction</a></code> from a connection of the pool
|
||||
Refer to <code><a href="../DB/BeginTransaction.html#transaction%28%26block%29-instance-method">BeginTransaction#transaction</a></code> for documentation.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/database.cr#L125" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="uri:URI-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>uri</strong> : URI
|
||||
|
||||
<a class="method-permalink" href="#uri%3AURI-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the uri with the connection settings to the database</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/database.cr#L34" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="using_connection(&block)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>using_connection</strong>(&block)
|
||||
|
||||
<a class="method-permalink" href="#using_connection%28%26block%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>yields a connection from the pool
|
||||
the connection is returned to the pool
|
||||
when the block ends</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/database.cr#L105" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
356
api/0.4.4/DB/Disposable.html
Normal file
356
api/0.4.4/DB/Disposable.html
Normal file
|
@ -0,0 +1,356 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::Disposable - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">module</span> DB::Disposable
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Generic module to encapsulate disposable db resources.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Direct including types</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/Connection.html">DB::Connection</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/ResultSet.html">DB::ResultSet</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/StatementMethods.html">DB::StatementMethods</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/Transaction.html">DB::Transaction</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/disposable.cr#L3" target="_blank">db/disposable.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#close-instance-method" class="signature"><strong>#close</strong></a>
|
||||
|
||||
<div class="summary"><p>Closes this object.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#closed%3F-instance-method" class="signature"><strong>#closed?</strong></a>
|
||||
|
||||
<div class="summary"><p>Returns <code>true</code> if this object is closed.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="close-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>close</strong>
|
||||
|
||||
<a class="method-permalink" href="#close-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Closes this object.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/disposable.cr#L9" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="closed?-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>closed?</strong>
|
||||
|
||||
<a class="method-permalink" href="#closed%3F-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns <code>true</code> if this object is closed. See <code><a href="../DB/Disposable.html#close-instance-method">#close</a></code>.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/disposable.cr#L16" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
378
api/0.4.4/DB/Driver.html
Normal file
378
api/0.4.4/DB/Driver.html
Normal file
|
@ -0,0 +1,378 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::Driver - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">abstract class</span> DB::Driver
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/Driver.html">DB::Driver</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Database driver implementors must subclass <code><a href="../DB/Driver.html">Driver</a></code>,
|
||||
register with a driver_name using <code><a href="../DB.html#register_driver%28driver_name%2Cdriver_class%3ADriver.class%29-class-method">DB#register_driver</a></code> and
|
||||
override the factory method <code><a href="../DB/Driver.html#build_connection%28context%3AConnectionContext%29%3AConnection-instance-method">#build_connection</a></code>.</p>
|
||||
|
||||
<pre><code><span class="k">require</span> <span class="s">"db"</span>
|
||||
|
||||
<span class="k">class</span> <span class="t">FakeDriver</span> <span class="o"><</span> <span class="t">DB</span><span class="t">::</span><span class="t">Driver</span>
|
||||
<span class="k">def</span> <span class="m">build_connection</span>(context : <span class="t">DB</span><span class="t">::</span><span class="t">ConnectionContext</span>)
|
||||
<span class="t">FakeConnection</span>.<span class="k">new</span> context
|
||||
<span class="k">end</span>
|
||||
<span class="k">end</span>
|
||||
|
||||
<span class="t">DB</span>.register_driver <span class="s">"fake"</span>, <span class="t">FakeDriver</span></code></pre>
|
||||
|
||||
<p>Access to this fake datbase will be available with</p>
|
||||
|
||||
<pre><code><span class="t">DB</span>.open <span class="s">"fake://..."</span> <span class="k">do</span> <span class="o">|</span>db<span class="o">|</span>
|
||||
<span class="c"># ... use db ...</span>
|
||||
<span class="k">end</span></code></pre>
|
||||
|
||||
<p>Refer to <code><a href="../DB/Connection.html">Connection</a></code>, <code><a href="../DB/Statement.html">Statement</a></code> and <code><a href="../DB/ResultSet.html">ResultSet</a></code> for further
|
||||
driver implementation instructions.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/driver.cr#L28" target="_blank">db/driver.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#build_connection%28context%3AConnectionContext%29%3AConnection-instance-method" class="signature"><strong>#build_connection</strong>(context : ConnectionContext) : Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#connection_pool_options%28params%3AHTTP%3A%3AParams%29-instance-method" class="signature"><strong>#connection_pool_options</strong>(params : HTTP::Params)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="build_connection(context:ConnectionContext):Connection-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>build_connection</strong>(context : <a href="../DB/ConnectionContext.html">ConnectionContext</a>) : <a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
<a class="method-permalink" href="#build_connection%28context%3AConnectionContext%29%3AConnection-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/driver.cr#L29" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="connection_pool_options(params:HTTP::Params)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>connection_pool_options</strong>(params : HTTP::Params)
|
||||
|
||||
<a class="method-permalink" href="#connection_pool_options%28params%3AHTTP%3A%3AParams%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/driver.cr#L31" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
795
api/0.4.4/DB/DriverSpecs.html
Normal file
795
api/0.4.4/DB/DriverSpecs.html
Normal file
|
@ -0,0 +1,795 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::DriverSpecs(DBAnyType) - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::DriverSpecs(DBAnyType)
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/DriverSpecs.html">DB::DriverSpecs(DBAnyType)</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Helper class to ensure behaviour of custom drivers</p>
|
||||
|
||||
<pre><code><span class="k">require</span> <span class="s">"db/spec"</span>
|
||||
|
||||
<span class="t">DB</span><span class="t">::</span><span class="t">DriverSpecs</span>(<span class="t">DB</span><span class="t">::</span><span class="t">Any</span>).run <span class="k">do</span>
|
||||
<span class="c"># How to connect to database</span>
|
||||
connection_string <span class="s">"scheme://database_url"</span>
|
||||
|
||||
<span class="c"># Clean up database if needed using before/after callbacks</span>
|
||||
before <span class="k">do</span>
|
||||
<span class="c"># ...</span>
|
||||
<span class="k">end</span>
|
||||
|
||||
after <span class="k">do</span>
|
||||
<span class="c"># ...</span>
|
||||
<span class="k">end</span>
|
||||
|
||||
<span class="c"># Sample values that will be stored, retrieved across many specs</span>
|
||||
sample_value <span class="s">"hello"</span>, <span class="s">"varchar(25)"</span>, <span class="s">"'hello'"</span>
|
||||
|
||||
it <span class="s">"custom spec with a db initialized"</span> <span class="k">do</span> <span class="o">|</span>db<span class="o">|</span>
|
||||
<span class="c"># assert something using *db*</span>
|
||||
<span class="k">end</span>
|
||||
|
||||
<span class="c"># Configure the appropiate syntax for different commands needed to run the specs</span>
|
||||
binding_syntax <span class="k">do</span> <span class="o">|</span>index<span class="o">|</span>
|
||||
<span class="s">"?"</span>
|
||||
<span class="k">end</span>
|
||||
|
||||
create_table_1column_syntax <span class="k">do</span> <span class="o">|</span>table_name, col1<span class="o">|</span>
|
||||
<span class="s">"create table </span><span class="i">#{</span></span>table_name<span class="s"><span class="i">}</span> (</span><span class="i">#{</span></span>col1.name<span class="s"><span class="i">}</span> </span><span class="i">#{</span></span>col1.sql_type<span class="s"><span class="i">}</span> </span><span class="i">#{</span></span>col1.null ? <span class="s">"NULL"</span> : <span class="s">"NOT NULL"</span><span class="s"><span class="i">}</span>)"</span>
|
||||
<span class="k">end</span>
|
||||
<span class="k">end</span></code></pre>
|
||||
|
||||
<p>The following methods needs to be called to configure the appropiate syntax
|
||||
for different commands and allow all the specs to run: <code><a href="../DB/DriverSpecs.html#binding_syntax%28%26binding_syntax%3AProc%28Int32%2CString%29%29-instance-method">#binding_syntax</a></code>, <code><a href="../DB/DriverSpecs.html#create_table_1column_syntax%28%26create_table_1column_syntax%3AProc%28String%2CColumnDef%2CString%29%29-instance-method">#create_table_1column_syntax</a></code>,
|
||||
<code><a href="../DB/DriverSpecs.html#create_table_2columns_syntax%28%26create_table_2columns_syntax%3AProc%28String%2CColumnDef%2CColumnDef%2CString%29%29-instance-method">#create_table_2columns_syntax</a></code>, <code><a href="../DB/DriverSpecs.html#select_1column_syntax%28%26select_1column_syntax%3AProc%28String%2CColumnDef%2CString%29%29-instance-method">#select_1column_syntax</a></code>, <code><a href="../DB/DriverSpecs.html#select_2columns_syntax%28%26select_2columns_syntax%3AProc%28String%2CColumnDef%2CColumnDef%2CString%29%29-instance-method">#select_2columns_syntax</a></code>, <code><a href="../DB/DriverSpecs.html#select_count_syntax%28%26select_count_syntax%3AProc%28String%2CString%29%29-instance-method">#select_count_syntax</a></code>,
|
||||
<code><a href="../DB/DriverSpecs.html#select_scalar_syntax%28%26select_scalar_syntax%3AProc%28String%2CString%3F%2CString%29%29-instance-method">#select_scalar_syntax</a></code>, <code><a href="../DB/DriverSpecs.html#insert_1column_syntax%28%26insert_1column_syntax%3AProc%28String%2CColumnDef%2CString%2CString%29%29-instance-method">#insert_1column_syntax</a></code>, <code><a href="../DB/DriverSpecs.html#insert_2columns_syntax%28%26insert_2columns_syntax%3AProc%28String%2CColumnDef%2CString%2CColumnDef%2CString%2CString%29%29-instance-method">#insert_2columns_syntax</a></code>, <code><a href="../DB/DriverSpecs.html#drop_table_if_exists_syntax%28%26drop_table_if_exists_syntax%3AProc%28String%2CString%29%29-instance-method">#drop_table_if_exists_syntax</a></code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L51" target="_blank">spec.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Class Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#run%28description%3D%26quot%3Basadb%26quot%3B%2C%26block%29-class-method" class="signature"><strong>.run</strong>(description = <span class="s">"as a db"</span>, &block)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#after%28%26after%3A-%3ENil%29-instance-method" class="signature"><strong>#after</strong>(&after : -> Nil)</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#before%28%26before%3A-%3ENil%29-instance-method" class="signature"><strong>#before</strong>(&before : -> Nil)</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#binding_syntax%28%26binding_syntax%3AProc%28Int32%2CString%29%29-instance-method" class="signature"><strong>#binding_syntax</strong>(&binding_syntax : Proc(Int32, String))</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#connection_string%28connection_string%3AString%29-instance-method" class="signature"><strong>#connection_string</strong>(connection_string : String)</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#create_table_1column_syntax%28%26create_table_1column_syntax%3AProc%28String%2CColumnDef%2CString%29%29-instance-method" class="signature"><strong>#create_table_1column_syntax</strong>(&create_table_1column_syntax : Proc(String, ColumnDef, String))</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#create_table_2columns_syntax%28%26create_table_2columns_syntax%3AProc%28String%2CColumnDef%2CColumnDef%2CString%29%29-instance-method" class="signature"><strong>#create_table_2columns_syntax</strong>(&create_table_2columns_syntax : Proc(String, ColumnDef, ColumnDef, String))</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#drop_table_if_exists_syntax%28%26drop_table_if_exists_syntax%3AProc%28String%2CString%29%29-instance-method" class="signature"><strong>#drop_table_if_exists_syntax</strong>(&drop_table_if_exists_syntax : Proc(String, String))</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#encode_null%28encode_null%3AString%29-instance-method" class="signature"><strong>#encode_null</strong>(encode_null : String)</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#insert_1column_syntax%28%26insert_1column_syntax%3AProc%28String%2CColumnDef%2CString%2CString%29%29-instance-method" class="signature"><strong>#insert_1column_syntax</strong>(&insert_1column_syntax : Proc(String, ColumnDef, String, String))</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#insert_2columns_syntax%28%26insert_2columns_syntax%3AProc%28String%2CColumnDef%2CString%2CColumnDef%2CString%2CString%29%29-instance-method" class="signature"><strong>#insert_2columns_syntax</strong>(&insert_2columns_syntax : Proc(String, ColumnDef, String, ColumnDef, String, String))</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#it%28description%3D%26quot%3Bassert%26quot%3B%2Cprepared%3D%3Adefault%2Cfile%3D__FILE__%2Cline%3D__LINE__%2Cend_line%3D__END_LINE__%2C%26block%3ADB%3A%3ADatabase-%3E%29-instance-method" class="signature"><strong>#it</strong>(description = <span class="s">"assert"</span>, prepared = <span class="n">:default</span>, file = __FILE__, line = __LINE__, end_line = __END_LINE__, &block : DB::Database -> )</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#its-instance-method" class="signature"><strong>#its</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#sample_value%28value%2Csql_type%2Cvalue_encoded%2C%2A%2Ctype_safe_value%3Dtrue%29-instance-method" class="signature"><strong>#sample_value</strong>(value, sql_type, value_encoded, *, type_safe_value = <span class="n">true</span>)</a>
|
||||
|
||||
<div class="summary"><p>Use <em>value</em> as sample value that should be stored in columns of type <em>sql_type</em>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#select_1column_syntax%28%26select_1column_syntax%3AProc%28String%2CColumnDef%2CString%29%29-instance-method" class="signature"><strong>#select_1column_syntax</strong>(&select_1column_syntax : Proc(String, ColumnDef, String))</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#select_2columns_syntax%28%26select_2columns_syntax%3AProc%28String%2CColumnDef%2CColumnDef%2CString%29%29-instance-method" class="signature"><strong>#select_2columns_syntax</strong>(&select_2columns_syntax : Proc(String, ColumnDef, ColumnDef, String))</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#select_count_syntax%28%26select_count_syntax%3AProc%28String%2CString%29%29-instance-method" class="signature"><strong>#select_count_syntax</strong>(&select_count_syntax : Proc(String, String))</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#select_scalar_syntax%28%26select_scalar_syntax%3AProc%28String%2CString%3F%2CString%29%29-instance-method" class="signature"><strong>#select_scalar_syntax</strong>(&select_scalar_syntax : Proc(String, String?, String))</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#support_prepared%28support_prepared%3ABool%29-instance-method" class="signature"><strong>#support_prepared</strong>(support_prepared : Bool)</a>
|
||||
|
||||
<div class="summary"><p>Allow specs that uses prepared statements (default <code>true</code>)</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#support_unprepared%28support_unprepared%3ABool%29-instance-method" class="signature"><strong>#support_unprepared</strong>(support_unprepared : Bool)</a>
|
||||
|
||||
<div class="summary"><p>Allow specs that uses unprepared statements (default <code>true</code>)</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Class Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="run(description=&quot;asadb&quot;,&block)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>run</strong>(description = <span class="s">"as a db"</span>, &block)
|
||||
|
||||
<a class="method-permalink" href="#run%28description%3D%26quot%3Basadb%26quot%3B%2C%26block%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L469" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="after(&after:->Nil)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>after</strong>(&after : -> Nil)
|
||||
|
||||
<a class="method-permalink" href="#after%28%26after%3A-%3ENil%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L63" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="before(&before:->Nil)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>before</strong>(&before : -> Nil)
|
||||
|
||||
<a class="method-permalink" href="#before%28%26before%3A-%3ENil%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L60" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="binding_syntax(&binding_syntax:Proc(Int32,String))-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>binding_syntax</strong>(&binding_syntax : Proc(Int32, String))
|
||||
|
||||
<a class="method-permalink" href="#binding_syntax%28%26binding_syntax%3AProc%28Int32%2CString%29%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L110" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="connection_string(connection_string:String)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>connection_string</strong>(connection_string : String)
|
||||
|
||||
<a class="method-permalink" href="#connection_string%28connection_string%3AString%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L109" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="create_table_1column_syntax(&create_table_1column_syntax:Proc(String,ColumnDef,String))-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>create_table_1column_syntax</strong>(&create_table_1column_syntax : Proc(String, <a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>, String))
|
||||
|
||||
<a class="method-permalink" href="#create_table_1column_syntax%28%26create_table_1column_syntax%3AProc%28String%2CColumnDef%2CString%29%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L112" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="create_table_2columns_syntax(&create_table_2columns_syntax:Proc(String,ColumnDef,ColumnDef,String))-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>create_table_2columns_syntax</strong>(&create_table_2columns_syntax : Proc(String, <a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>, <a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>, String))
|
||||
|
||||
<a class="method-permalink" href="#create_table_2columns_syntax%28%26create_table_2columns_syntax%3AProc%28String%2CColumnDef%2CColumnDef%2CString%29%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L113" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="drop_table_if_exists_syntax(&drop_table_if_exists_syntax:Proc(String,String))-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>drop_table_if_exists_syntax</strong>(&drop_table_if_exists_syntax : Proc(String, String))
|
||||
|
||||
<a class="method-permalink" href="#drop_table_if_exists_syntax%28%26drop_table_if_exists_syntax%3AProc%28String%2CString%29%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L119" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="encode_null(encode_null:String)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>encode_null</strong>(encode_null : String)
|
||||
|
||||
<a class="method-permalink" href="#encode_null%28encode_null%3AString%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L66" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="insert_1column_syntax(&insert_1column_syntax:Proc(String,ColumnDef,String,String))-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>insert_1column_syntax</strong>(&insert_1column_syntax : Proc(String, <a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>, String, String))
|
||||
|
||||
<a class="method-permalink" href="#insert_1column_syntax%28%26insert_1column_syntax%3AProc%28String%2CColumnDef%2CString%2CString%29%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L114" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="insert_2columns_syntax(&insert_2columns_syntax:Proc(String,ColumnDef,String,ColumnDef,String,String))-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>insert_2columns_syntax</strong>(&insert_2columns_syntax : Proc(String, <a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>, String, <a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>, String, String))
|
||||
|
||||
<a class="method-permalink" href="#insert_2columns_syntax%28%26insert_2columns_syntax%3AProc%28String%2CColumnDef%2CString%2CColumnDef%2CString%2CString%29%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L115" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="it(description=&quot;assert&quot;,prepared=:default,file=__FILE__,line=__LINE__,end_line=__END_LINE__,&block:DB::Database->)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>it</strong>(description = <span class="s">"assert"</span>, prepared = <span class="n">:default</span>, file = __FILE__, line = __LINE__, end_line = __END_LINE__, &block : <a href="../DB/Database.html">DB::Database</a> -> )
|
||||
|
||||
<a class="method-permalink" href="#it%28description%3D%26quot%3Bassert%26quot%3B%2Cprepared%3D%3Adefault%2Cfile%3D__FILE__%2Cline%3D__LINE__%2Cend_line%3D__END_LINE__%2C%26block%3ADB%3A%3ADatabase-%3E%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L125" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="its-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>its</strong>
|
||||
|
||||
<a class="method-permalink" href="#its-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L123" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="sample_value(value,sql_type,value_encoded,*,type_safe_value=true)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>sample_value</strong>(value, sql_type, value_encoded, *, type_safe_value = <span class="n">true</span>)
|
||||
|
||||
<a class="method-permalink" href="#sample_value%28value%2Csql_type%2Cvalue_encoded%2C%2A%2Ctype_safe_value%3Dtrue%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Use <em>value</em> as sample value that should be stored in columns of type <em>sql_type</em>.
|
||||
<em>value_encoded</em> is driver specific expression that should generate that value in the database.
|
||||
<em>type_safe_value</em> indicates whether <em>value_encoded</em> is expected to generate the <em>value</em> even without
|
||||
been stored in a table (default <code>true</code>).</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L139" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="select_1column_syntax(&select_1column_syntax:Proc(String,ColumnDef,String))-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>select_1column_syntax</strong>(&select_1column_syntax : Proc(String, <a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>, String))
|
||||
|
||||
<a class="method-permalink" href="#select_1column_syntax%28%26select_1column_syntax%3AProc%28String%2CColumnDef%2CString%29%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L116" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="select_2columns_syntax(&select_2columns_syntax:Proc(String,ColumnDef,ColumnDef,String))-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>select_2columns_syntax</strong>(&select_2columns_syntax : Proc(String, <a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>, <a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>, String))
|
||||
|
||||
<a class="method-permalink" href="#select_2columns_syntax%28%26select_2columns_syntax%3AProc%28String%2CColumnDef%2CColumnDef%2CString%29%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L117" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="select_count_syntax(&select_count_syntax:Proc(String,String))-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>select_count_syntax</strong>(&select_count_syntax : Proc(String, String))
|
||||
|
||||
<a class="method-permalink" href="#select_count_syntax%28%26select_count_syntax%3AProc%28String%2CString%29%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L118" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="select_scalar_syntax(&select_scalar_syntax:Proc(String,String?,String))-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>select_scalar_syntax</strong>(&select_scalar_syntax : Proc(String, String?, String))
|
||||
|
||||
<a class="method-permalink" href="#select_scalar_syntax%28%26select_scalar_syntax%3AProc%28String%2CString%3F%2CString%29%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L111" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="support_prepared(support_prepared:Bool)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>support_prepared</strong>(support_prepared : Bool)
|
||||
|
||||
<a class="method-permalink" href="#support_prepared%28support_prepared%3ABool%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Allow specs that uses prepared statements (default <code>true</code>)</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L70" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="support_unprepared(support_unprepared:Bool)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>support_unprepared</strong>(support_unprepared : Bool)
|
||||
|
||||
<a class="method-permalink" href="#support_unprepared%28support_unprepared%3ABool%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Allow specs that uses unprepared statements (default <code>true</code>)</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L79" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
428
api/0.4.4/DB/DriverSpecs/ColumnDef.html
Normal file
428
api/0.4.4/DB/DriverSpecs/ColumnDef.html
Normal file
|
@ -0,0 +1,428 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../../js/doc.js"></script>
|
||||
<title>DB::DriverSpecs::ColumnDef - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">struct</span> DB::DriverSpecs::ColumnDef
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../../DB/DriverSpecs/ColumnDef.html">DB::DriverSpecs::ColumnDef</a></li><li class="superclass">Struct</li><li class="superclass">Value</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L52" target="_blank">spec.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28name%3AString%2Csql_type%3AString%2Cnull%3ABool%29-class-method" class="signature"><strong>.new</strong>(name : String, sql_type : String, null : Bool)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#clone-instance-method" class="signature"><strong>#clone</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#name%3AString-instance-method" class="signature"><strong>#name</strong> : String</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#null%3ABool-instance-method" class="signature"><strong>#null</strong> : Bool</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#sql_type%3AString-instance-method" class="signature"><strong>#sql_type</strong> : String</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(name:String,sql_type:String,null:Bool)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(name : String, sql_type : String, null : Bool)
|
||||
|
||||
<a class="method-permalink" href="#new%28name%3AString%2Csql_type%3AString%2Cnull%3ABool%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L52" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="clone-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>clone</strong>
|
||||
|
||||
<a class="method-permalink" href="#clone-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/spec.cr#L52" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="name:String-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>name</strong> : String
|
||||
|
||||
<a class="method-permalink" href="#name%3AString-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="null:Bool-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>null</strong> : Bool
|
||||
|
||||
<a class="method-permalink" href="#null%3ABool-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="sql_type:String-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>sql_type</strong> : String
|
||||
|
||||
<a class="method-permalink" href="#sql_type%3AString-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
330
api/0.4.4/DB/Error.html
Normal file
330
api/0.4.4/DB/Error.html
Normal file
|
@ -0,0 +1,330 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::Error - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::Error
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/Error.html">DB::Error</a></li><li class="superclass">Exception</li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/ConnectionLost.html">DB::ConnectionLost</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/ConnectionRefused.html">DB::ConnectionRefused</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/MappingException.html">DB::MappingException</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/PoolRetryAttemptsExceeded.html">DB::PoolRetryAttemptsExceeded</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/PoolTimeout.html">DB::PoolTimeout</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/Rollback.html">DB::Rollback</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/error.cr#L2" target="_blank">db/error.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
413
api/0.4.4/DB/ExecResult.html
Normal file
413
api/0.4.4/DB/ExecResult.html
Normal file
|
@ -0,0 +1,413 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::ExecResult - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">struct</span> DB::ExecResult
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/ExecResult.html">DB::ExecResult</a></li><li class="superclass">Struct</li><li class="superclass">Value</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Result of a <code>#exec</code> statement.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db.cr#L80" target="_blank">db.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28rows_affected%3AInt64%2Clast_insert_id%3AInt64%29-class-method" class="signature"><strong>.new</strong>(rows_affected : Int64, last_insert_id : Int64)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#clone-instance-method" class="signature"><strong>#clone</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#last_insert_id%3AInt64-instance-method" class="signature"><strong>#last_insert_id</strong> : Int64</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#rows_affected%3AInt64-instance-method" class="signature"><strong>#rows_affected</strong> : Int64</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(rows_affected:Int64,last_insert_id:Int64)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(rows_affected : Int64, last_insert_id : Int64)
|
||||
|
||||
<a class="method-permalink" href="#new%28rows_affected%3AInt64%2Clast_insert_id%3AInt64%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db.cr#L80" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="clone-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>clone</strong>
|
||||
|
||||
<a class="method-permalink" href="#clone-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db.cr#L80" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="last_insert_id:Int64-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>last_insert_id</strong> : Int64
|
||||
|
||||
<a class="method-permalink" href="#last_insert_id%3AInt64-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="rows_affected:Int64-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>rows_affected</strong> : Int64
|
||||
|
||||
<a class="method-permalink" href="#rows_affected%3AInt64-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
285
api/0.4.4/DB/Mappable.html
Normal file
285
api/0.4.4/DB/Mappable.html
Normal file
|
@ -0,0 +1,285 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::Mappable - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">module</span> DB::Mappable
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Empty module used for marking a class as supporting DB:Mapping</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/mapping.cr#L3" target="_blank">db/mapping.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
323
api/0.4.4/DB/MappingException.html
Normal file
323
api/0.4.4/DB/MappingException.html
Normal file
|
@ -0,0 +1,323 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::MappingException - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::MappingException
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/MappingException.html">DB::MappingException</a></li><li class="superclass"><a href="../DB/Error.html">DB::Error</a></li><li class="superclass">Exception</li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/error.cr#L5" target="_blank">db/error.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
463
api/0.4.4/DB/Pool.html
Normal file
463
api/0.4.4/DB/Pool.html
Normal file
|
@ -0,0 +1,463 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::Pool(T) - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::Pool(T)
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/Pool.html">DB::Pool(T)</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L4" target="_blank">db/pool.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28initial_pool_size%3D1%2Cmax_pool_size%3D0%2Cmax_idle_pool_size%3D1%2Ccheckout_timeout%3D5.0%2Cretry_attempts%3D1%2Cretry_delay%3D0.2%2C%26factory%3A-%3ET%29-class-method" class="signature"><strong>.new</strong>(initial_pool_size = <span class="n">1</span>, max_pool_size = <span class="n">0</span>, max_idle_pool_size = <span class="n">1</span>, checkout_timeout = <span class="n">5.0</span>, retry_attempts = <span class="n">1</span>, retry_delay = <span class="n">0.2</span>, &factory : -> T)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#checkout%3AT-instance-method" class="signature"><strong>#checkout</strong> : T</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#checkout_some%28candidates%3AEnumerable%28WeakRef%28T%29%29%29%3A%3A%3ATuple%28T%2CBool%29-instance-method" class="signature"><strong>#checkout_some</strong>(candidates : Enumerable(WeakRef(T))) : ::Tuple(T, Bool)</a>
|
||||
|
||||
<div class="summary"><pre><code class='language-selected, is_candidate = pool.checkout_some(candidates) ``` `selected` be a resource from the `candidates` list and `is_candidate` == `true` or `selected` will be a new resource adn `is_candidate` == `false`'></code></pre></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#close%3ANil-instance-method" class="signature"><strong>#close</strong> : Nil</a>
|
||||
|
||||
<div class="summary"><p>close all resources in the pool</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#release%28resource%3AT%29%3ANil-instance-method" class="signature"><strong>#release</strong>(resource : T) : Nil</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#retry%28%26block%29-instance-method" class="signature"><strong>#retry</strong>(&block)</a>
|
||||
|
||||
<div class="summary"><p>:nodoc: Will retry the block if a <code><a href="../DB/ConnectionLost.html">ConnectionLost</a></code> exception is thrown.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(initial_pool_size=1,max_pool_size=0,max_idle_pool_size=1,checkout_timeout=5.0,retry_attempts=1,retry_delay=0.2,&factory:->T)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(initial_pool_size = <span class="n">1</span>, max_pool_size = <span class="n">0</span>, max_idle_pool_size = <span class="n">1</span>, checkout_timeout = <span class="n">5.0</span>, retry_attempts = <span class="n">1</span>, retry_delay = <span class="n">0.2</span>, &factory : -> T)
|
||||
|
||||
<a class="method-permalink" href="#new%28initial_pool_size%3D1%2Cmax_pool_size%3D0%2Cmax_idle_pool_size%3D1%2Ccheckout_timeout%3D5.0%2Cretry_attempts%3D1%2Cretry_delay%3D0.2%2C%26factory%3A-%3ET%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L15" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="checkout:T-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>checkout</strong> : T
|
||||
|
||||
<a class="method-permalink" href="#checkout%3AT-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L31" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="checkout_some(candidates:Enumerable(WeakRef(T))):::Tuple(T,Bool)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>checkout_some</strong>(candidates : Enumerable(WeakRef(T))) : ::Tuple(T, Bool)
|
||||
|
||||
<a class="method-permalink" href="#checkout_some%28candidates%3AEnumerable%28WeakRef%28T%29%29%29%3A%3A%3ATuple%28T%2CBool%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><pre><code>selected, is_candidate <span class="o">=</span> pool.checkout_some(candidates)</code></pre>
|
||||
|
||||
<p><code>selected</code> be a resource from the <code>candidates</code> list and <code>is_candidate</code> == <code>true</code>
|
||||
or <code>selected</code> will be a new resource adn <code>is_candidate</code> == <code>false</code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L53" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="close:Nil-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>close</strong> : Nil
|
||||
|
||||
<a class="method-permalink" href="#close%3ANil-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>close all resources in the pool</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L25" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="release(resource:T):Nil-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>release</strong>(resource : T) : Nil
|
||||
|
||||
<a class="method-permalink" href="#release%28resource%3AT%29%3ANil-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L69" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="retry(&block)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>retry</strong>(&block)
|
||||
|
||||
<a class="method-permalink" href="#retry%28%26block%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>:nodoc:
|
||||
Will retry the block if a <code><a href="../DB/ConnectionLost.html">ConnectionLost</a></code> exception is thrown.
|
||||
It will try to reuse all of the available connection right away,
|
||||
but if a new connection is needed there is a <code>retry_delay</code> seconds delay.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L84" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
403
api/0.4.4/DB/Pool/TimeoutHelper.html
Normal file
403
api/0.4.4/DB/Pool/TimeoutHelper.html
Normal file
|
@ -0,0 +1,403 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../../js/doc.js"></script>
|
||||
<title>DB::Pool::TimeoutHelper - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::Pool::TimeoutHelper
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../../DB/Pool/TimeoutHelper.html">DB::Pool::TimeoutHelper</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L183" target="_blank">db/pool.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28timeout%3AFloat64%29-class-method" class="signature"><strong>.new</strong>(timeout : Float64)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#cancel-instance-method" class="signature"><strong>#cancel</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#receive_select_action-instance-method" class="signature"><strong>#receive_select_action</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#start-instance-method" class="signature"><strong>#start</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(timeout:Float64)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(timeout : Float64)
|
||||
|
||||
<a class="method-permalink" href="#new%28timeout%3AFloat64%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L184" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="cancel-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>cancel</strong>
|
||||
|
||||
<a class="method-permalink" href="#cancel-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L202" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="receive_select_action-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>receive_select_action</strong>
|
||||
|
||||
<a class="method-permalink" href="#receive_select_action-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L189" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="start-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>start</strong>
|
||||
|
||||
<a class="method-permalink" href="#start-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool.cr#L193" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
431
api/0.4.4/DB/PoolPreparedStatement.html
Normal file
431
api/0.4.4/DB/PoolPreparedStatement.html
Normal file
|
@ -0,0 +1,431 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::PoolPreparedStatement - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::PoolPreparedStatement
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/PoolPreparedStatement.html">DB::PoolPreparedStatement</a></li><li class="superclass"><a href="../DB/PoolStatement.html">DB::PoolStatement</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Represents a statement to be executed in any of the connections
|
||||
of the pool. The statement is not be executed in a prepared fashion.
|
||||
The execution of the statement is retried according to the pool configuration.</p>
|
||||
|
||||
<p>See <code><a href="../DB/PoolStatement.html">PoolStatement</a></code></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_prepared_statement.cr#L7" target="_blank">db/pool_prepared_statement.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28db%3ADatabase%2Cquery%3AString%29-class-method" class="signature"><strong>.new</strong>(db : Database, query : String)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from class <code><a href="../DB/PoolStatement.html">DB::PoolStatement</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/PoolStatement.html#exec%28args%3AArray%29%3AExecResult-instance-method" class="tooltip">
|
||||
<span>exec(args : Array) : ExecResult<br/>exec : ExecResult<br/>exec(*args) : ExecResult</span>
|
||||
exec</a>,
|
||||
|
||||
|
||||
<a href="../DB/PoolStatement.html#query%28args%3AArray%29%3AResultSet-instance-method" class="tooltip">
|
||||
<span>query(args : Array) : ResultSet<br/>query : ResultSet<br/>query(*args) : ResultSet</span>
|
||||
query</a>,
|
||||
|
||||
|
||||
<a href="../DB/PoolStatement.html#scalar%28%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>scalar(*args)</span>
|
||||
scalar</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Constructor methods inherited from class <code><a href="../DB/PoolStatement.html">DB::PoolStatement</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/PoolStatement.html#new%28db%3ADatabase%2Cquery%3AString%29-class-method" class="tooltip">
|
||||
<span>new(db : Database, query : String)</span>
|
||||
new</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/StatementMethods.html">DB::StatementMethods</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/StatementMethods.html#exec%28args%3AArray%29%3AExecResult-instance-method" class="tooltip">
|
||||
<span>exec(args : Array) : ExecResult<br/>exec : ExecResult<br/>exec(*args) : ExecResult</span>
|
||||
exec</a>,
|
||||
|
||||
|
||||
<a href="../DB/StatementMethods.html#query%28%2Aargs%2C%26block%29-instance-method" class="tooltip">
|
||||
<span>query(*args, &block)<br/>query(args : Array) : ResultSet<br/>query : ResultSet<br/>query(*args) : ResultSet</span>
|
||||
query</a>,
|
||||
|
||||
|
||||
<a href="../DB/StatementMethods.html#scalar%28%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>scalar(*args)</span>
|
||||
scalar</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/Disposable.html">DB::Disposable</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#close-instance-method" class="tooltip">
|
||||
<span>close</span>
|
||||
close</a>,
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#closed%3F-instance-method" class="tooltip">
|
||||
<span>closed?</span>
|
||||
closed?</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(db:Database,query:String)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(db : <a href="../DB/Database.html">Database</a>, query : String)
|
||||
|
||||
<a class="method-permalink" href="#new%28db%3ADatabase%2Cquery%3AString%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_prepared_statement.cr#L11" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
323
api/0.4.4/DB/PoolRetryAttemptsExceeded.html
Normal file
323
api/0.4.4/DB/PoolRetryAttemptsExceeded.html
Normal file
|
@ -0,0 +1,323 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::PoolRetryAttemptsExceeded - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::PoolRetryAttemptsExceeded
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/PoolRetryAttemptsExceeded.html">DB::PoolRetryAttemptsExceeded</a></li><li class="superclass"><a href="../DB/Error.html">DB::Error</a></li><li class="superclass">Exception</li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/error.cr#L11" target="_blank">db/error.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
591
api/0.4.4/DB/PoolStatement.html
Normal file
591
api/0.4.4/DB/PoolStatement.html
Normal file
|
@ -0,0 +1,591 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::PoolStatement - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">abstract class</span> DB::PoolStatement
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/PoolStatement.html">DB::PoolStatement</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>When a statement is to be executed in a DB that has a connection pool
|
||||
a statement from the DB needs to be able to represent a statement in any
|
||||
of the connections of the pool. Otherwise the user will need to deal with
|
||||
actual connections in some point.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Included Modules</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/StatementMethods.html">DB::StatementMethods</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/PoolPreparedStatement.html">DB::PoolPreparedStatement</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/PoolUnpreparedStatement.html">DB::PoolUnpreparedStatement</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_statement.cr#L6" target="_blank">db/pool_statement.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28db%3ADatabase%2Cquery%3AString%29-class-method" class="signature"><strong>.new</strong>(db : Database, query : String)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#exec%28args%3AArray%29%3AExecResult-instance-method" class="signature"><strong>#exec</strong>(args : Array) : ExecResult</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#exec%3AExecResult-instance-method" class="signature"><strong>#exec</strong> : ExecResult</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#exec%28%2Aargs%29%3AExecResult-instance-method" class="signature"><strong>#exec</strong>(*args) : ExecResult</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28args%3AArray%29%3AResultSet-instance-method" class="signature"><strong>#query</strong>(args : Array) : ResultSet</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%3AResultSet-instance-method" class="signature"><strong>#query</strong> : ResultSet</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28%2Aargs%29%3AResultSet-instance-method" class="signature"><strong>#query</strong>(*args) : ResultSet</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#scalar%28%2Aargs%29-instance-method" class="signature"><strong>#scalar</strong>(*args)</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#scalar%28query%2C%2Aargs%29-instance-method">QueryMethods#scalar</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/StatementMethods.html">DB::StatementMethods</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/StatementMethods.html#exec%28args%3AArray%29%3AExecResult-instance-method" class="tooltip">
|
||||
<span>exec(args : Array) : ExecResult<br/>exec : ExecResult<br/>exec(*args) : ExecResult</span>
|
||||
exec</a>,
|
||||
|
||||
|
||||
<a href="../DB/StatementMethods.html#query%28%2Aargs%2C%26block%29-instance-method" class="tooltip">
|
||||
<span>query(*args, &block)<br/>query(args : Array) : ResultSet<br/>query : ResultSet<br/>query(*args) : ResultSet</span>
|
||||
query</a>,
|
||||
|
||||
|
||||
<a href="../DB/StatementMethods.html#scalar%28%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>scalar(*args)</span>
|
||||
scalar</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/Disposable.html">DB::Disposable</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#close-instance-method" class="tooltip">
|
||||
<span>close</span>
|
||||
close</a>,
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#closed%3F-instance-method" class="tooltip">
|
||||
<span>closed?</span>
|
||||
closed?</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(db:Database,query:String)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(db : <a href="../DB/Database.html">Database</a>, query : String)
|
||||
|
||||
<a class="method-permalink" href="#new%28db%3ADatabase%2Cquery%3AString%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_statement.cr#L9" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="exec(args:Array):ExecResult-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>exec</strong>(args : Array) : <a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
<a class="method-permalink" href="#exec%28args%3AArray%29%3AExecResult-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_statement.cr#L23" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="exec:ExecResult-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>exec</strong> : <a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
<a class="method-permalink" href="#exec%3AExecResult-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_statement.cr#L13" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="exec(*args):ExecResult-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>exec</strong>(*args) : <a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
<a class="method-permalink" href="#exec%28%2Aargs%29%3AExecResult-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_statement.cr#L18" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query(args:Array):ResultSet-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query</strong>(args : Array) : <a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
<a class="method-permalink" href="#query%28args%3AArray%29%3AResultSet-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_statement.cr#L38" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query:ResultSet-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query</strong> : <a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
<a class="method-permalink" href="#query%3AResultSet-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_statement.cr#L28" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query(*args):ResultSet-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query</strong>(*args) : <a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
<a class="method-permalink" href="#query%28%2Aargs%29%3AResultSet-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_statement.cr#L33" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="scalar(*args)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>scalar</strong>(*args)
|
||||
|
||||
<a class="method-permalink" href="#scalar%28%2Aargs%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#scalar%28query%2C%2Aargs%29-instance-method">QueryMethods#scalar</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_statement.cr#L43" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
323
api/0.4.4/DB/PoolTimeout.html
Normal file
323
api/0.4.4/DB/PoolTimeout.html
Normal file
|
@ -0,0 +1,323 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::PoolTimeout - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::PoolTimeout
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/PoolTimeout.html">DB::PoolTimeout</a></li><li class="superclass"><a href="../DB/Error.html">DB::Error</a></li><li class="superclass">Exception</li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/error.cr#L8" target="_blank">db/error.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
431
api/0.4.4/DB/PoolUnpreparedStatement.html
Normal file
431
api/0.4.4/DB/PoolUnpreparedStatement.html
Normal file
|
@ -0,0 +1,431 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::PoolUnpreparedStatement - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::PoolUnpreparedStatement
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/PoolUnpreparedStatement.html">DB::PoolUnpreparedStatement</a></li><li class="superclass"><a href="../DB/PoolStatement.html">DB::PoolStatement</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Represents a statement to be executed in any of the connections
|
||||
of the pool. The statement is not be executed in a non prepared fashion.
|
||||
The execution of the statement is retried according to the pool configuration.</p>
|
||||
|
||||
<p>See <code><a href="../DB/PoolStatement.html">PoolStatement</a></code></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_unprepared_statement.cr#L7" target="_blank">db/pool_unprepared_statement.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28db%3ADatabase%2Cquery%3AString%29-class-method" class="signature"><strong>.new</strong>(db : Database, query : String)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from class <code><a href="../DB/PoolStatement.html">DB::PoolStatement</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/PoolStatement.html#exec%28args%3AArray%29%3AExecResult-instance-method" class="tooltip">
|
||||
<span>exec(args : Array) : ExecResult<br/>exec : ExecResult<br/>exec(*args) : ExecResult</span>
|
||||
exec</a>,
|
||||
|
||||
|
||||
<a href="../DB/PoolStatement.html#query%28args%3AArray%29%3AResultSet-instance-method" class="tooltip">
|
||||
<span>query(args : Array) : ResultSet<br/>query : ResultSet<br/>query(*args) : ResultSet</span>
|
||||
query</a>,
|
||||
|
||||
|
||||
<a href="../DB/PoolStatement.html#scalar%28%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>scalar(*args)</span>
|
||||
scalar</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Constructor methods inherited from class <code><a href="../DB/PoolStatement.html">DB::PoolStatement</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/PoolStatement.html#new%28db%3ADatabase%2Cquery%3AString%29-class-method" class="tooltip">
|
||||
<span>new(db : Database, query : String)</span>
|
||||
new</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/StatementMethods.html">DB::StatementMethods</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/StatementMethods.html#exec%28args%3AArray%29%3AExecResult-instance-method" class="tooltip">
|
||||
<span>exec(args : Array) : ExecResult<br/>exec : ExecResult<br/>exec(*args) : ExecResult</span>
|
||||
exec</a>,
|
||||
|
||||
|
||||
<a href="../DB/StatementMethods.html#query%28%2Aargs%2C%26block%29-instance-method" class="tooltip">
|
||||
<span>query(*args, &block)<br/>query(args : Array) : ResultSet<br/>query : ResultSet<br/>query(*args) : ResultSet</span>
|
||||
query</a>,
|
||||
|
||||
|
||||
<a href="../DB/StatementMethods.html#scalar%28%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>scalar(*args)</span>
|
||||
scalar</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/Disposable.html">DB::Disposable</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#close-instance-method" class="tooltip">
|
||||
<span>close</span>
|
||||
close</a>,
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#closed%3F-instance-method" class="tooltip">
|
||||
<span>closed?</span>
|
||||
closed?</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(db:Database,query:String)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(db : <a href="../DB/Database.html">Database</a>, query : String)
|
||||
|
||||
<a class="method-permalink" href="#new%28db%3ADatabase%2Cquery%3AString%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/pool_unprepared_statement.cr#L8" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
836
api/0.4.4/DB/QueryMethods.html
Normal file
836
api/0.4.4/DB/QueryMethods.html
Normal file
|
@ -0,0 +1,836 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::QueryMethods - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">module</span> DB::QueryMethods
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Methods to allow querying a database.
|
||||
All methods accepts a <code>query : String</code> and a set arguments.</p>
|
||||
|
||||
<p>Three kind of statements can be performed:</p>
|
||||
|
||||
<ol><li><code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">#exec</a></code> waits no record response from the database. An <code><a href="../DB/ExecResult.html">ExecResult</a></code> is returned.</li><li><code><a href="../DB/QueryMethods.html#scalar%28query%2C%2Aargs%29-instance-method">#scalar</a></code> reads a single value of the response. A union of possible values is returned.</li><li><code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">#query</a></code> returns a <code><a href="../DB/ResultSet.html">ResultSet</a></code> that allows iteration over the rows in the response and column information.</li></ol>
|
||||
|
||||
<p>Arguments can be passed by position</p>
|
||||
|
||||
<pre><code>db.query(<span class="s">"SELECT name FROM ... WHERE age > ?"</span>, age)</code></pre>
|
||||
|
||||
<p>Convention of mapping how arguments are mapped to the query depends on each driver.</p>
|
||||
|
||||
<p>Including <code><a href="../DB/QueryMethods.html">QueryMethods</a></code> requires a <code>build(query) : <a href="../DB/Statement.html">Statement</a></code> method that is not expected
|
||||
to be called directly.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Direct including types</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/SessionMethods.html">DB::SessionMethods(Session, Stmt)</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/SessionMethods/PreparedQuery.html">DB::SessionMethods::PreparedQuery(Session, Stmt)</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/SessionMethods/UnpreparedQuery.html">DB::SessionMethods::UnpreparedQuery(Session, Stmt)</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L20" target="_blank">db/query_methods.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#exec%28query%2C%2Aargs%29-instance-method" class="signature"><strong>#exec</strong>(query, *args)</a>
|
||||
|
||||
<div class="summary"><p>Performs the <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">#query</a></code> and returns an <code><a href="../DB/ExecResult.html">ExecResult</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28query%2C%2Aargs%29-instance-method" class="signature"><strong>#query</strong>(query, *args)</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> and returns a <code><a href="../DB/ResultSet.html">ResultSet</a></code> with the results.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28query%2C%2Aargs%2C%26block%29-instance-method" class="signature"><strong>#query</strong>(query, *args, &block)</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> and yields a <code><a href="../DB/ResultSet.html">ResultSet</a></code> with the results.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_all%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="signature"><strong>#query_all</strong>(query, *args, as type : Class)</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> and returns an array where the value of each row is read as the given <em>type</em>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_all%28query%2C%2Aargs%2Castypes%3ANamedTuple%29-instance-method" class="signature"><strong>#query_all</strong>(query, *args, as types : NamedTuple)</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> and returns an array where each row is read as a named tuple of the given <em>types</em> (the keys of the named tuple are not necessarily the column names).</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_all%28query%2C%2Aargs%2C%26block%3AResultSet-%3EU%29%3AArray%28U%29forallU-instance-method" class="signature"><strong>#query_all</strong>(query, *args, &block : ResultSet -> U) : Array(U) forall U</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> and yield a <code><a href="../DB/ResultSet.html">ResultSet</a></code> positioned at the beginning of each row, returning an array of the values of the blocks.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_all%28query%2C%2Aargs%2Castypes%3ATuple%29-instance-method" class="signature"><strong>#query_all</strong>(query, *args, as types : Tuple)</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> and returns an array where each row is read as a tuple of the given <em>types</em>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_each%28query%2C%2Aargs%2C%26block%29-instance-method" class="signature"><strong>#query_each</strong>(query, *args, &block)</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> and yields the <code><a href="../DB/ResultSet.html">ResultSet</a></code> once per each row.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_one%28query%2C%2Aargs%2C%26block%3AResultSet-%3EU%29%3AUforallU-instance-method" class="signature"><strong>#query_one</strong>(query, *args, &block : ResultSet -> U) : U forall U</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> that expects a single row and yields a <code><a href="../DB/ResultSet.html">ResultSet</a></code> positioned at that first row.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_one%28query%2C%2Aargs%2Castypes%3ATuple%29-instance-method" class="signature"><strong>#query_one</strong>(query, *args, as types : Tuple)</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> that expects a single row and returns it as a tuple of the given <em>types</em>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_one%28query%2C%2Aargs%2Castypes%3ANamedTuple%29-instance-method" class="signature"><strong>#query_one</strong>(query, *args, as types : NamedTuple)</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> that expects a single row and returns it as a named tuple of the given <em>types</em> (the keys of the named tuple are not necessarily the column names).</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_one%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="signature"><strong>#query_one</strong>(query, *args, as type : Class)</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> that expects a single row and returns the first column's value as the given <em>type</em>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_one%3F%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="signature"><strong>#query_one?</strong>(query, *args, as type : Class)</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> that expects a single row and returns the first column's value as the given <em>type</em>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_one%3F%28query%2C%2Aargs%2Castypes%3ANamedTuple%29-instance-method" class="signature"><strong>#query_one?</strong>(query, *args, as types : NamedTuple)</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> that expects a single row and returns it as a named tuple of the given <em>types</em> (the keys of the named tuple are not necessarily the column names).</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_one%3F%28query%2C%2Aargs%2Castypes%3ATuple%29-instance-method" class="signature"><strong>#query_one?</strong>(query, *args, as types : Tuple)</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> that expects a single row and returns it as a tuple of the given <em>types</em>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query_one%3F%28query%2C%2Aargs%2C%26block%3AResultSet-%3EU%29%3AU%3FforallU-instance-method" class="signature"><strong>#query_one?</strong>(query, *args, &block : ResultSet -> U) : U? forall U</a>
|
||||
|
||||
<div class="summary"><p>Executes a <em>query</em> that expects at most a single row and yields a <code><a href="../DB/ResultSet.html">ResultSet</a></code> positioned at that first row.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#scalar%28query%2C%2Aargs%29-instance-method" class="signature"><strong>#scalar</strong>(query, *args)</a>
|
||||
|
||||
<div class="summary"><p>Performs the <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">#query</a></code> and returns a single scalar value puts db.scalar("SELECT MAX(name)").as(String) # => (a String)</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="exec(query,*args)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>exec</strong>(query, *args)
|
||||
|
||||
<a class="method-permalink" href="#exec%28query%2C%2Aargs%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Performs the <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">#query</a></code> and returns an <code><a href="../DB/ExecResult.html">ExecResult</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L262" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query(query,*args)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query</strong>(query, *args)
|
||||
|
||||
<a class="method-permalink" href="#query%28query%2C%2Aargs%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> and returns a <code><a href="../DB/ResultSet.html">ResultSet</a></code> with the results.
|
||||
The <code><a href="../DB/ResultSet.html">ResultSet</a></code> must be closed manually.</p>
|
||||
|
||||
<pre><code>result <span class="o">=</span> db.query <span class="s">"select name from contacts where id = ?"</span>, <span class="n">10</span>
|
||||
<span class="k">begin</span>
|
||||
<span class="k">if</span> result.move_next
|
||||
id <span class="o">=</span> result.read(<span class="t">Int32</span>)
|
||||
<span class="k">end</span>
|
||||
<span class="k">ensure</span>
|
||||
result.close
|
||||
<span class="k">end</span></code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L37" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query(query,*args,&block)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query</strong>(query, *args, &block)
|
||||
|
||||
<a class="method-permalink" href="#query%28query%2C%2Aargs%2C%26block%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> and yields a <code><a href="../DB/ResultSet.html">ResultSet</a></code> with the results.
|
||||
The <code><a href="../DB/ResultSet.html">ResultSet</a></code> is closed automatically.</p>
|
||||
|
||||
<pre><code>db.query(<span class="s">"select name from contacts where age > ?"</span>, <span class="n">18</span>) <span class="k">do</span> <span class="o">|</span>rs<span class="o">|</span>
|
||||
rs.each <span class="k">do</span>
|
||||
name <span class="o">=</span> rs.read(<span class="t">String</span>)
|
||||
<span class="k">end</span>
|
||||
<span class="k">end</span></code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L51" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_all(query,*args,astype:Class)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_all</strong>(query, *args, as type : Class)
|
||||
|
||||
<a class="method-permalink" href="#query_all%28query%2C%2Aargs%2Castype%3AClass%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> and returns an array where the
|
||||
value of each row is read as the given <em>type</em>.</p>
|
||||
|
||||
<pre><code>names <span class="o">=</span> db.query_all <span class="s">"select name from contacts"</span>, <span class="k">as</span>: <span class="t">String</span></code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L239" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_all(query,*args,astypes:NamedTuple)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_all</strong>(query, *args, as types : NamedTuple)
|
||||
|
||||
<a class="method-permalink" href="#query_all%28query%2C%2Aargs%2Castypes%3ANamedTuple%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> and returns an array where each row is
|
||||
read as a named tuple of the given <em>types</em> (the keys of the named tuple
|
||||
are not necessarily the column names).</p>
|
||||
|
||||
<pre><code>contacts <span class="o">=</span> db.query_all <span class="s">"select name, age from contacts"</span>, <span class="k">as</span>: {name: <span class="t">String</span>, age: <span class="t">Int32</span>}</code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L227" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_all(query,*args,&block:ResultSet->U):Array(U)forallU-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_all</strong>(query, *args, &block : <a href="../DB/ResultSet.html">ResultSet</a> -> U) : Array(U) forall U
|
||||
|
||||
<a class="method-permalink" href="#query_all%28query%2C%2Aargs%2C%26block%3AResultSet-%3EU%29%3AArray%28U%29forallU-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> and yield a <code><a href="../DB/ResultSet.html">ResultSet</a></code> positioned at the beginning
|
||||
of each row, returning an array of the values of the blocks.</p>
|
||||
|
||||
<pre><code>names <span class="o">=</span> db.query_all <span class="s">"select name from contacts"</span>, <span class="o">&</span>.read(<span class="t">String</span>)</code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L200" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_all(query,*args,astypes:Tuple)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_all</strong>(query, *args, as types : Tuple)
|
||||
|
||||
<a class="method-permalink" href="#query_all%28query%2C%2Aargs%2Castypes%3ATuple%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> and returns an array where each row is
|
||||
read as a tuple of the given <em>types</em>.</p>
|
||||
|
||||
<pre><code>contacts <span class="o">=</span> db.query_all <span class="s">"select name, age from contacts"</span>, <span class="k">as</span>: {<span class="t">String</span>, <span class="t">Int32</span>}</code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L214" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_each(query,*args,&block)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_each</strong>(query, *args, &block)
|
||||
|
||||
<a class="method-permalink" href="#query_each%28query%2C%2Aargs%2C%26block%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> and yields the <code><a href="../DB/ResultSet.html">ResultSet</a></code> once per each row.
|
||||
The <code><a href="../DB/ResultSet.html">ResultSet</a></code> is closed automatically.</p>
|
||||
|
||||
<pre><code>db.query_each <span class="s">"select name from contacts"</span> <span class="k">do</span> <span class="o">|</span>rs<span class="o">|</span>
|
||||
puts rs.read(<span class="t">String</span>)
|
||||
<span class="k">end</span></code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L253" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_one(query,*args,&block:ResultSet->U):UforallU-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_one</strong>(query, *args, &block : <a href="../DB/ResultSet.html">ResultSet</a> -> U) : U forall U
|
||||
|
||||
<a class="method-permalink" href="#query_one%28query%2C%2Aargs%2C%26block%3AResultSet-%3EU%29%3AUforallU-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> that expects a single row and yields a <code><a href="../DB/ResultSet.html">ResultSet</a></code>
|
||||
positioned at that first row.</p>
|
||||
|
||||
<p>The given block must not invoke <code>move_next</code> on the yielded result set.</p>
|
||||
|
||||
<p>Raises <code><a href="../DB/Error.html">DB::Error</a></code> if there were no rows, or if there were more than one row.</p>
|
||||
|
||||
<pre><code>name <span class="o">=</span> db.query_one <span class="s">"select name from contacts where id = ?"</span>, <span class="n">18</span>, <span class="o">&</span>.read(<span class="t">String</span>)</code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L67" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_one(query,*args,astypes:Tuple)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_one</strong>(query, *args, as types : Tuple)
|
||||
|
||||
<a class="method-permalink" href="#query_one%28query%2C%2Aargs%2Castypes%3ATuple%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> that expects a single row and returns it
|
||||
as a tuple of the given <em>types</em>.</p>
|
||||
|
||||
<p>Raises <code><a href="../DB/Error.html">DB::Error</a></code> if there were no rows, or if there were more than one row.</p>
|
||||
|
||||
<pre><code>db.query_one <span class="s">"select name, age from contacts where id = ?"</span>, <span class="n">1</span>, <span class="k">as</span>: {<span class="t">String</span>, <span class="t">Int32</span>}</code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L85" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_one(query,*args,astypes:NamedTuple)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_one</strong>(query, *args, as types : NamedTuple)
|
||||
|
||||
<a class="method-permalink" href="#query_one%28query%2C%2Aargs%2Castypes%3ANamedTuple%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> that expects a single row and returns it
|
||||
as a named tuple of the given <em>types</em> (the keys of the named tuple
|
||||
are not necessarily the column names).</p>
|
||||
|
||||
<p>Raises <code><a href="../DB/Error.html">DB::Error</a></code> if there were no rows, or if there were more than one row.</p>
|
||||
|
||||
<pre><code>db.query_one <span class="s">"select name, age from contacts where id = ?"</span>, <span class="n">1</span>, <span class="k">as</span>: {name: <span class="t">String</span>, age: <span class="t">Int32</span>}</code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L100" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_one(query,*args,astype:Class)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_one</strong>(query, *args, as type : Class)
|
||||
|
||||
<a class="method-permalink" href="#query_one%28query%2C%2Aargs%2Castype%3AClass%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> that expects a single row
|
||||
and returns the first column's value as the given <em>type</em>.</p>
|
||||
|
||||
<p>Raises <code><a href="../DB/Error.html">DB::Error</a></code> if there were no rows, or if there were more than one row.</p>
|
||||
|
||||
<pre><code>db.query_one <span class="s">"select name from contacts where id = ?"</span>, <span class="n">1</span>, <span class="k">as</span>: <span class="t">String</span></code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L114" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_one?(query,*args,astype:Class)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_one?</strong>(query, *args, as type : Class)
|
||||
|
||||
<a class="method-permalink" href="#query_one%3F%28query%2C%2Aargs%2Castype%3AClass%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> that expects a single row
|
||||
and returns the first column's value as the given <em>type</em>.</p>
|
||||
|
||||
<p>Returns <code>nil</code> if there were no rows.</p>
|
||||
|
||||
<p>Raises <code><a href="../DB/Error.html">DB::Error</a></code> if there were more than one row.</p>
|
||||
|
||||
<pre><code>name <span class="o">=</span> db.query_one? <span class="s">"select name from contacts where id = ?"</span>, <span class="n">1</span>, <span class="k">as</span>: <span class="t">String</span>
|
||||
<span class="k">typeof</span>(name) <span class="c"># => String?</span></code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L188" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_one?(query,*args,astypes:NamedTuple)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_one?</strong>(query, *args, as types : NamedTuple)
|
||||
|
||||
<a class="method-permalink" href="#query_one%3F%28query%2C%2Aargs%2Castypes%3ANamedTuple%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> that expects a single row and returns it
|
||||
as a named tuple of the given <em>types</em> (the keys of the named tuple
|
||||
are not necessarily the column names).</p>
|
||||
|
||||
<p>Returns <code>nil</code> if there were no rows.</p>
|
||||
|
||||
<p>Raises <code><a href="../DB/Error.html">DB::Error</a></code> if there were more than one row.</p>
|
||||
|
||||
<pre><code>result <span class="o">=</span> db.query_one? <span class="s">"select name, age from contacts where id = ?"</span>, <span class="n">1</span>, <span class="k">as</span>: {age: <span class="t">String</span>, name: <span class="t">Int32</span>}
|
||||
<span class="k">typeof</span>(result) <span class="c"># => NamedTuple(age: String, name: Int32) | Nil</span></code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L171" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_one?(query,*args,astypes:Tuple)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_one?</strong>(query, *args, as types : Tuple)
|
||||
|
||||
<a class="method-permalink" href="#query_one%3F%28query%2C%2Aargs%2Castypes%3ATuple%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> that expects a single row and returns it
|
||||
as a tuple of the given <em>types</em>.</p>
|
||||
|
||||
<p>Returns <code>nil</code> if there were no rows.</p>
|
||||
|
||||
<p>Raises <code><a href="../DB/Error.html">DB::Error</a></code> if there were more than one row.</p>
|
||||
|
||||
<pre><code>result <span class="o">=</span> db.query_one? <span class="s">"select name, age from contacts where id = ?"</span>, <span class="n">1</span>, <span class="k">as</span>: {<span class="t">String</span>, <span class="t">Int32</span>}
|
||||
<span class="k">typeof</span>(result) <span class="c"># => Tuple(String, Int32) | Nil</span></code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L153" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query_one?(query,*args,&block:ResultSet->U):U?forallU-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query_one?</strong>(query, *args, &block : <a href="../DB/ResultSet.html">ResultSet</a> -> U) : U? forall U
|
||||
|
||||
<a class="method-permalink" href="#query_one%3F%28query%2C%2Aargs%2C%26block%3AResultSet-%3EU%29%3AU%3FforallU-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a <em>query</em> that expects at most a single row and yields a <code><a href="../DB/ResultSet.html">ResultSet</a></code>
|
||||
positioned at that first row.</p>
|
||||
|
||||
<p>Returns <code>nil</code>, not invoking the block, if there were no rows.</p>
|
||||
|
||||
<p>Raises <code><a href="../DB/Error.html">DB::Error</a></code> if there were more than one row
|
||||
(this ends up invoking the block once).</p>
|
||||
|
||||
<pre><code>name <span class="o">=</span> db.query_one? <span class="s">"select name from contacts where id = ?"</span>, <span class="n">18</span>, <span class="o">&</span>.read(<span class="t">String</span>)
|
||||
<span class="k">typeof</span>(name) <span class="c"># => String | Nil</span></code></pre></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L132" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="scalar(query,*args)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>scalar</strong>(query, *args)
|
||||
|
||||
<a class="method-permalink" href="#scalar%28query%2C%2Aargs%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Performs the <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">#query</a></code> and returns a single scalar value
|
||||
puts db.scalar("SELECT MAX(name)").as(String) # => (a String)</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/query_methods.cr#L268" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
668
api/0.4.4/DB/ResultSet.html
Normal file
668
api/0.4.4/DB/ResultSet.html
Normal file
|
@ -0,0 +1,668 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::ResultSet - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">abstract class</span> DB::ResultSet
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/ResultSet.html">DB::ResultSet</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>The response of a query performed on a <code><a href="../DB/Database.html">Database</a></code>.</p>
|
||||
|
||||
<p>See <code><a href="../DB.html">DB</a></code> for a complete sample.</p>
|
||||
|
||||
<p>Each <code><a href="../DB/ResultSet.html#read-instance-method">#read</a></code> call consumes the result and moves to the next column.
|
||||
Each column must be read in order.
|
||||
At any moment a <code><a href="../DB/ResultSet.html#move_next%3ABool-instance-method">#move_next</a></code> can be invoked, meaning to skip the
|
||||
remaining, or even all the columns, in the current row.
|
||||
Also it is not mandatory to consume the whole <code><a href="../DB/ResultSet.html">ResultSet</a></code>, hence an iteration
|
||||
through <code><a href="../DB/ResultSet.html#each%28%26block%29-instance-method">#each</a></code> or <code><a href="../DB/ResultSet.html#move_next%3ABool-instance-method">#move_next</a></code> can be stopped.</p>
|
||||
|
||||
<p><strong>Note:</strong> depending on how the <code><a href="../DB/ResultSet.html">ResultSet</a></code> was obtained it might be mandatory an
|
||||
explicit call to <code>#close</code>. Check <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code>.</p>
|
||||
|
||||
<h3>Note to implementors</h3>
|
||||
|
||||
<ol><li>Override <code><a href="../DB/ResultSet.html#move_next%3ABool-instance-method">#move_next</a></code> to move to the next row.</li><li>Override <code><a href="../DB/ResultSet.html#read-instance-method">#read</a></code> returning the next value in the row.</li><li>(Optional) Override <code><a href="../DB/ResultSet.html#read%28type%3ADB%3A%3AMappable.class%29-instance-method">#read(t)</a></code> for some types <code>t</code> for which custom logic other than a simple cast is needed.</li><li>Override <code><a href="../DB/ResultSet.html#column_count%3AInt32-instance-method">#column_count</a></code>, <code><a href="../DB/ResultSet.html#column_name%28index%3AInt32%29%3AString-instance-method">#column_name</a></code>.</li></ol>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Included Modules</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/Disposable.html">DB::Disposable</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L22" target="_blank">db/result_set.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28statement%3ADB%3A%3AStatement%29-class-method" class="signature"><strong>.new</strong>(statement : DB::Statement)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#column_count%3AInt32-instance-method" class="signature"><strong>#column_count</strong> : Int32</a>
|
||||
|
||||
<div class="summary"><p>Returns the number of columns in the result</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#column_name%28index%3AInt32%29%3AString-instance-method" class="signature"><strong>#column_name</strong>(index : Int32) : String</a>
|
||||
|
||||
<div class="summary"><p>Returns the name of the column in <code>index</code> 0-based position.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#column_names-instance-method" class="signature"><strong>#column_names</strong></a>
|
||||
|
||||
<div class="summary"><p>Returns the name of the columns.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#each%28%26block%29-instance-method" class="signature"><strong>#each</strong>(&block)</a>
|
||||
|
||||
<div class="summary"><p>Iterates over all the rows</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#each_column%28%26block%29-instance-method" class="signature"><strong>#each_column</strong>(&block)</a>
|
||||
|
||||
<div class="summary"><p>Iterates over all the columns</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#move_next%3ABool-instance-method" class="signature"><strong>#move_next</strong> : Bool</a>
|
||||
|
||||
<div class="summary"><p>Move the next row in the result.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#read%28type%3ADB%3A%3AMappable.class%29-instance-method" class="signature"><strong>#read</strong>(type : DB::Mappable.class)</a>
|
||||
|
||||
<div class="summary"><p>Reads the next columns and maps them to a class</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#read%28type%3AT.class%29%3ATforallT-instance-method" class="signature"><strong>#read</strong>(type : T.class) : T forall T</a>
|
||||
|
||||
<div class="summary"><p>Reads the next column value as a <strong>type</strong></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#read-instance-method" class="signature"><strong>#read</strong></a>
|
||||
|
||||
<div class="summary"><p>Reads the next columns and returns a named tuple of the values.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#read-instance-method" class="signature"><strong>#read</strong></a>
|
||||
|
||||
<div class="summary"><p>Reads the next column value</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#read%28%2Atypes%3AClass%29-instance-method" class="signature"><strong>#read</strong>(*types : Class)</a>
|
||||
|
||||
<div class="summary"><p>Reads the next columns and returns a tuple of the values.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/Disposable.html">DB::Disposable</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#close-instance-method" class="tooltip">
|
||||
<span>close</span>
|
||||
close</a>,
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#closed%3F-instance-method" class="tooltip">
|
||||
<span>closed?</span>
|
||||
closed?</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(statement:DB::Statement)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(statement : <a href="../DB/Statement.html">DB::Statement</a>)
|
||||
|
||||
<a class="method-permalink" href="#new%28statement%3ADB%3A%3AStatement%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L28" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="column_count:Int32-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>column_count</strong> : Int32
|
||||
|
||||
<a class="method-permalink" href="#column_count%3AInt32-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the number of columns in the result</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L59" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="column_name(index:Int32):String-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>column_name</strong>(index : Int32) : String
|
||||
|
||||
<a class="method-permalink" href="#column_name%28index%3AInt32%29%3AString-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the name of the column in <code>index</code> 0-based position.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L62" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="column_names-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>column_names</strong>
|
||||
|
||||
<a class="method-permalink" href="#column_names-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the name of the columns.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L65" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="each(&block)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>each</strong>(&block)
|
||||
|
||||
<a class="method-permalink" href="#each%28%26block%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Iterates over all the rows</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L38" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="each_column(&block)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>each_column</strong>(&block)
|
||||
|
||||
<a class="method-permalink" href="#each_column%28%26block%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Iterates over all the columns</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L45" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="move_next:Bool-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>move_next</strong> : Bool
|
||||
|
||||
<a class="method-permalink" href="#move_next%3ABool-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Move the next row in the result.
|
||||
Return <code>false</code> if no more rows are available.
|
||||
See <code><a href="../DB/ResultSet.html#each%28%26block%29-instance-method">#each</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L54" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="read(type:DB::Mappable.class)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>read</strong>(type : DB::Mappable.class)
|
||||
|
||||
<a class="method-permalink" href="#read%28type%3ADB%3A%3AMappable.class%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Reads the next columns and maps them to a class</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L73" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="read(type:T.class):TforallT-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>read</strong>(type : T.class) : T forall T
|
||||
|
||||
<a class="method-permalink" href="#read%28type%3AT.class%29%3ATforallT-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Reads the next column value as a <strong>type</strong></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L78" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="read-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>read</strong>
|
||||
|
||||
<a class="method-permalink" href="#read-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Reads the next columns and returns a named tuple of the values.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L93" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="read-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>read</strong>
|
||||
|
||||
<a class="method-permalink" href="#read-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Reads the next column value</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L70" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="read(*types:Class)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>read</strong>(*types : Class)
|
||||
|
||||
<a class="method-permalink" href="#read%28%2Atypes%3AClass%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Reads the next columns and returns a tuple of the values.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/result_set.cr#L88" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
323
api/0.4.4/DB/Rollback.html
Normal file
323
api/0.4.4/DB/Rollback.html
Normal file
|
@ -0,0 +1,323 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::Rollback - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::Rollback
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/Rollback.html">DB::Rollback</a></li><li class="superclass"><a href="../DB/Error.html">DB::Error</a></li><li class="superclass">Exception</li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/error.cr#L30" target="_blank">db/error.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
548
api/0.4.4/DB/SavePointTransaction.html
Normal file
548
api/0.4.4/DB/SavePointTransaction.html
Normal file
|
@ -0,0 +1,548 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::SavePointTransaction - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::SavePointTransaction
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/SavePointTransaction.html">DB::SavePointTransaction</a></li><li class="superclass"><a href="../DB/Transaction.html">DB::Transaction</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L94" target="_blank">db/transaction.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28parent%3ATransaction%2Csavepoint_name%3AString%29-class-method" class="signature"><strong>.new</strong>(parent : Transaction, savepoint_name : String)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#begin_transaction%3ATransaction-instance-method" class="signature"><strong>#begin_transaction</strong> : Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#commit-instance-method" class="signature"><strong>#commit</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#connection%3AConnection-instance-method" class="signature"><strong>#connection</strong> : Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#create_save_point_transaction%28parent%3ATransaction%29-instance-method" class="signature"><strong>#create_save_point_transaction</strong>(parent : Transaction)</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#release_from_nested_transaction-instance-method" class="signature"><strong>#release_from_nested_transaction</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#rollback-instance-method" class="signature"><strong>#rollback</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from class <code><a href="../DB/Transaction.html">DB::Transaction</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/Transaction.html#commit-instance-method" class="tooltip">
|
||||
<span>commit</span>
|
||||
commit</a>,
|
||||
|
||||
|
||||
<a href="../DB/Transaction.html#connection%3AConnection-instance-method" class="tooltip">
|
||||
<span>connection : Connection</span>
|
||||
connection</a>,
|
||||
|
||||
|
||||
<a href="../DB/Transaction.html#release_from_nested_transaction-instance-method" class="tooltip">
|
||||
<span>release_from_nested_transaction</span>
|
||||
release_from_nested_transaction</a>,
|
||||
|
||||
|
||||
<a href="../DB/Transaction.html#rollback-instance-method" class="tooltip">
|
||||
<span>rollback</span>
|
||||
rollback</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/BeginTransaction.html">DB::BeginTransaction</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/BeginTransaction.html#begin_transaction%3ATransaction-instance-method" class="tooltip">
|
||||
<span>begin_transaction : Transaction</span>
|
||||
begin_transaction</a>,
|
||||
|
||||
|
||||
<a href="../DB/BeginTransaction.html#transaction%28%26block%29-instance-method" class="tooltip">
|
||||
<span>transaction(&block)</span>
|
||||
transaction</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/Disposable.html">DB::Disposable</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#close-instance-method" class="tooltip">
|
||||
<span>close</span>
|
||||
close</a>,
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#closed%3F-instance-method" class="tooltip">
|
||||
<span>closed?</span>
|
||||
closed?</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(parent:Transaction,savepoint_name:String)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(parent : <a href="../DB/Transaction.html">Transaction</a>, savepoint_name : String)
|
||||
|
||||
<a class="method-permalink" href="#new%28parent%3ATransaction%2Csavepoint_name%3AString%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L97" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="begin_transaction:Transaction-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>begin_transaction</strong> : <a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
<a class="method-permalink" href="#begin_transaction%3ATransaction-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L117" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="commit-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>commit</strong>
|
||||
|
||||
<a class="method-permalink" href="#commit-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L103" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="connection:Connection-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>connection</strong> : <a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
<a class="method-permalink" href="#connection%3AConnection-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L95" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="create_save_point_transaction(parent:Transaction)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>create_save_point_transaction</strong>(parent : <a href="../DB/Transaction.html">Transaction</a>)
|
||||
|
||||
<a class="method-permalink" href="#create_save_point_transaction%28parent%3ATransaction%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L123" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="release_from_nested_transaction-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>release_from_nested_transaction</strong>
|
||||
|
||||
<a class="method-permalink" href="#release_from_nested_transaction-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L127" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="rollback-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>rollback</strong>
|
||||
|
||||
<a class="method-permalink" href="#rollback-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L108" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
556
api/0.4.4/DB/SessionMethods.html
Normal file
556
api/0.4.4/DB/SessionMethods.html
Normal file
|
@ -0,0 +1,556 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::SessionMethods(Session, Stmt) - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">module</span> DB::SessionMethods(Session, Stmt)
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Methods that are shared accross session like objects:</p>
|
||||
|
||||
<ul><li>Database</li><li>Connection</li></ul></ul>
|
||||
|
||||
<p>Classes that includes this module are able to execute
|
||||
queries and statements in both prepared and unprepared fashion.</p>
|
||||
|
||||
<p>This module serves for dsl reuse over session like objects.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Included Modules</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/QueryMethods.html">DB::QueryMethods</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Direct including types</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/Connection.html">DB::Connection</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/Database.html">DB::Database</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L10" target="_blank">db/session_methods.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#build%28query%29%3AStmt-instance-method" class="signature"><strong>#build</strong>(query) : Stmt</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#build_unprepared_statement%28query%29%3AStmt-instance-method" class="signature"><strong>#build_unprepared_statement</strong>(query) : Stmt</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#fetch_or_build_prepared_statement%28query%29%3AStmt-instance-method" class="signature"><strong>#fetch_or_build_prepared_statement</strong>(query) : Stmt</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#prepared%28query%29-instance-method" class="signature"><strong>#prepared</strong>(query)</a>
|
||||
|
||||
<div class="summary"><p>Returns a prepared <code><a href="../DB/Statement.html">Statement</a></code> that has not been executed yet.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#prepared-instance-method" class="signature"><strong>#prepared</strong></a>
|
||||
|
||||
<div class="summary"><p>dsl helper to build prepared statements returns a value that includes <code><a href="../DB/QueryMethods.html">QueryMethods</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#prepared_statements%3F%3ABool-instance-method" class="signature"><strong>#prepared_statements?</strong> : Bool</a>
|
||||
|
||||
<div class="summary"><p>Returns whether by default the statements should be prepared or not.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#unprepared%28query%29-instance-method" class="signature"><strong>#unprepared</strong>(query)</a>
|
||||
|
||||
<div class="summary"><p>Returns an unprepared <code><a href="../DB/Statement.html">Statement</a></code> that has not been executed yet.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#unprepared-instance-method" class="signature"><strong>#unprepared</strong></a>
|
||||
|
||||
<div class="summary"><p>dsl helper to build unprepared statements returns a value that includes <code><a href="../DB/QueryMethods.html">QueryMethods</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/QueryMethods.html">DB::QueryMethods</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>exec(query, *args)</span>
|
||||
exec</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>query(query, *args)<br/>query(query, *args, &block)</span>
|
||||
query</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query_all%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="tooltip">
|
||||
<span>query_all(query, *args, as type : Class)<br/>query_all(query, *args, as types : NamedTuple)<br/>query_all(query, *args, &block : ResultSet -> U) : Array(U) forall U<br/>query_all(query, *args, as types : Tuple)</span>
|
||||
query_all</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query_each%28query%2C%2Aargs%2C%26block%29-instance-method" class="tooltip">
|
||||
<span>query_each(query, *args, &block)</span>
|
||||
query_each</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query_one%28query%2C%2Aargs%2C%26block%3AResultSet-%3EU%29%3AUforallU-instance-method" class="tooltip">
|
||||
<span>query_one(query, *args, &block : ResultSet -> U) : U forall U<br/>query_one(query, *args, as types : Tuple)<br/>query_one(query, *args, as types : NamedTuple)<br/>query_one(query, *args, as type : Class)</span>
|
||||
query_one</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#query_one%3F%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="tooltip">
|
||||
<span>query_one?(query, *args, as type : Class)<br/>query_one?(query, *args, as types : NamedTuple)<br/>query_one?(query, *args, as types : Tuple)<br/>query_one?(query, *args, &block : ResultSet -> U) : U? forall U</span>
|
||||
query_one?</a>,
|
||||
|
||||
|
||||
<a href="../DB/QueryMethods.html#scalar%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>scalar(query, *args)</span>
|
||||
scalar</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="build(query):Stmt-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>build</strong>(query) : Stmt
|
||||
|
||||
<a class="method-permalink" href="#build%28query%29%3AStmt-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L21" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="build_unprepared_statement(query):Stmt-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>build_unprepared_statement</strong>(query) : Stmt
|
||||
|
||||
<a class="method-permalink" href="#build_unprepared_statement%28query%29%3AStmt-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L19" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="fetch_or_build_prepared_statement(query):Stmt-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>fetch_or_build_prepared_statement</strong>(query) : Stmt
|
||||
|
||||
<a class="method-permalink" href="#fetch_or_build_prepared_statement%28query%29%3AStmt-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L17" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="prepared(query)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>prepared</strong>(query)
|
||||
|
||||
<a class="method-permalink" href="#prepared%28query%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns a prepared <code><a href="../DB/Statement.html">Statement</a></code> that has not been executed yet.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L36" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="prepared-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>prepared</strong>
|
||||
|
||||
<a class="method-permalink" href="#prepared-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>dsl helper to build prepared statements
|
||||
returns a value that includes <code><a href="../DB/QueryMethods.html">QueryMethods</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L31" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="prepared_statements?:Bool-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>prepared_statements?</strong> : Bool
|
||||
|
||||
<a class="method-permalink" href="#prepared_statements%3F%3ABool-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns whether by default the statements should
|
||||
be prepared or not.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L15" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="unprepared(query)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>unprepared</strong>(query)
|
||||
|
||||
<a class="method-permalink" href="#unprepared%28query%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns an unprepared <code><a href="../DB/Statement.html">Statement</a></code> that has not been executed yet.</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L47" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="unprepared-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>unprepared</strong>
|
||||
|
||||
<a class="method-permalink" href="#unprepared-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>dsl helper to build unprepared statements
|
||||
returns a value that includes <code><a href="../DB/QueryMethods.html">QueryMethods</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L42" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
427
api/0.4.4/DB/SessionMethods/PreparedQuery.html
Normal file
427
api/0.4.4/DB/SessionMethods/PreparedQuery.html
Normal file
|
@ -0,0 +1,427 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../../js/doc.js"></script>
|
||||
<title>DB::SessionMethods::PreparedQuery(Session, Stmt) - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">struct</span> DB::SessionMethods::PreparedQuery(Session, Stmt)
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../../DB/SessionMethods/PreparedQuery.html">DB::SessionMethods::PreparedQuery(Session, Stmt)</a></li><li class="superclass">Struct</li><li class="superclass">Value</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Included Modules</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../../DB/QueryMethods.html">DB::QueryMethods</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L51" target="_blank">db/session_methods.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28session%3ASession%29-class-method" class="signature"><strong>.new</strong>(session : Session)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#build%28query%29%3AStmt-instance-method" class="signature"><strong>#build</strong>(query) : Stmt</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../../DB/QueryMethods.html">DB::QueryMethods</a></code></h3>
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>exec(query, *args)</span>
|
||||
exec</a>,
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>query(query, *args)<br/>query(query, *args, &block)</span>
|
||||
query</a>,
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#query_all%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="tooltip">
|
||||
<span>query_all(query, *args, as type : Class)<br/>query_all(query, *args, as types : NamedTuple)<br/>query_all(query, *args, &block : ResultSet -> U) : Array(U) forall U<br/>query_all(query, *args, as types : Tuple)</span>
|
||||
query_all</a>,
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#query_each%28query%2C%2Aargs%2C%26block%29-instance-method" class="tooltip">
|
||||
<span>query_each(query, *args, &block)</span>
|
||||
query_each</a>,
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#query_one%28query%2C%2Aargs%2C%26block%3AResultSet-%3EU%29%3AUforallU-instance-method" class="tooltip">
|
||||
<span>query_one(query, *args, &block : ResultSet -> U) : U forall U<br/>query_one(query, *args, as types : Tuple)<br/>query_one(query, *args, as types : NamedTuple)<br/>query_one(query, *args, as type : Class)</span>
|
||||
query_one</a>,
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#query_one%3F%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="tooltip">
|
||||
<span>query_one?(query, *args, as type : Class)<br/>query_one?(query, *args, as types : NamedTuple)<br/>query_one?(query, *args, as types : Tuple)<br/>query_one?(query, *args, &block : ResultSet -> U) : U? forall U</span>
|
||||
query_one?</a>,
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#scalar%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>scalar(query, *args)</span>
|
||||
scalar</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(session:Session)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(session : Session)
|
||||
|
||||
<a class="method-permalink" href="#new%28session%3ASession%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L54" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="build(query):Stmt-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>build</strong>(query) : Stmt
|
||||
|
||||
<a class="method-permalink" href="#build%28query%29%3AStmt-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L57" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
427
api/0.4.4/DB/SessionMethods/UnpreparedQuery.html
Normal file
427
api/0.4.4/DB/SessionMethods/UnpreparedQuery.html
Normal file
|
@ -0,0 +1,427 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../../js/doc.js"></script>
|
||||
<title>DB::SessionMethods::UnpreparedQuery(Session, Stmt) - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">struct</span> DB::SessionMethods::UnpreparedQuery(Session, Stmt)
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../../DB/SessionMethods/UnpreparedQuery.html">DB::SessionMethods::UnpreparedQuery(Session, Stmt)</a></li><li class="superclass">Struct</li><li class="superclass">Value</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Included Modules</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../../DB/QueryMethods.html">DB::QueryMethods</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L62" target="_blank">db/session_methods.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28session%3ASession%29-class-method" class="signature"><strong>.new</strong>(session : Session)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#build%28query%29%3AStmt-instance-method" class="signature"><strong>#build</strong>(query) : Stmt</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../../DB/QueryMethods.html">DB::QueryMethods</a></code></h3>
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>exec(query, *args)</span>
|
||||
exec</a>,
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>query(query, *args)<br/>query(query, *args, &block)</span>
|
||||
query</a>,
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#query_all%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="tooltip">
|
||||
<span>query_all(query, *args, as type : Class)<br/>query_all(query, *args, as types : NamedTuple)<br/>query_all(query, *args, &block : ResultSet -> U) : Array(U) forall U<br/>query_all(query, *args, as types : Tuple)</span>
|
||||
query_all</a>,
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#query_each%28query%2C%2Aargs%2C%26block%29-instance-method" class="tooltip">
|
||||
<span>query_each(query, *args, &block)</span>
|
||||
query_each</a>,
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#query_one%28query%2C%2Aargs%2C%26block%3AResultSet-%3EU%29%3AUforallU-instance-method" class="tooltip">
|
||||
<span>query_one(query, *args, &block : ResultSet -> U) : U forall U<br/>query_one(query, *args, as types : Tuple)<br/>query_one(query, *args, as types : NamedTuple)<br/>query_one(query, *args, as type : Class)</span>
|
||||
query_one</a>,
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#query_one%3F%28query%2C%2Aargs%2Castype%3AClass%29-instance-method" class="tooltip">
|
||||
<span>query_one?(query, *args, as type : Class)<br/>query_one?(query, *args, as types : NamedTuple)<br/>query_one?(query, *args, as types : Tuple)<br/>query_one?(query, *args, &block : ResultSet -> U) : U? forall U</span>
|
||||
query_one?</a>,
|
||||
|
||||
|
||||
<a href="../../DB/QueryMethods.html#scalar%28query%2C%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>scalar(query, *args)</span>
|
||||
scalar</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(session:Session)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(session : Session)
|
||||
|
||||
<a class="method-permalink" href="#new%28session%3ASession%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L65" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="build(query):Stmt-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>build</strong>(query) : Stmt
|
||||
|
||||
<a class="method-permalink" href="#build%28query%29%3AStmt-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/session_methods.cr#L68" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
580
api/0.4.4/DB/Statement.html
Normal file
580
api/0.4.4/DB/Statement.html
Normal file
|
@ -0,0 +1,580 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::Statement - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">abstract class</span> DB::Statement
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/Statement.html">DB::Statement</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Represents a query in a <code><a href="../DB/Connection.html">Connection</a></code>.
|
||||
It should be created by <code><a href="../DB/QueryMethods.html">QueryMethods</a></code>.</p>
|
||||
|
||||
<h3>Note to implementors</h3>
|
||||
|
||||
<ol><li>Subclass <code>Statements</code></li><li><code>Statements</code> are created from a custom driver <code>Connection#prepare</code> method.</li><li><code>#perform_query</code> executes a query that is expected to return a <code><a href="../DB/ResultSet.html">ResultSet</a></code></li><li><code>#perform_exec</code> executes a query that is expected to return an <code><a href="../DB/ExecResult.html">ExecResult</a></code></li><li><code>#do_close</code> is called to release the statement resources.</li></ol>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Included Modules</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/StatementMethods.html">DB::StatementMethods</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L52" target="_blank">db/statement.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28connection%3AConnection%29-class-method" class="signature"><strong>.new</strong>(connection : Connection)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#exec%28args%3AArray%29-instance-method" class="signature"><strong>#exec</strong>(args : Array)</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#exec-instance-method" class="signature"><strong>#exec</strong></a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#exec%28%2Aargs%29-instance-method" class="signature"><strong>#exec</strong>(*args)</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28args%3AArray%29-instance-method" class="signature"><strong>#query</strong>(args : Array)</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query-instance-method" class="signature"><strong>#query</strong></a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28%2Aargs%29-instance-method" class="signature"><strong>#query</strong>(*args)</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#release_connection-instance-method" class="signature"><strong>#release_connection</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/StatementMethods.html">DB::StatementMethods</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/StatementMethods.html#exec%28args%3AArray%29%3AExecResult-instance-method" class="tooltip">
|
||||
<span>exec(args : Array) : ExecResult<br/>exec : ExecResult<br/>exec(*args) : ExecResult</span>
|
||||
exec</a>,
|
||||
|
||||
|
||||
<a href="../DB/StatementMethods.html#query%28%2Aargs%2C%26block%29-instance-method" class="tooltip">
|
||||
<span>query(*args, &block)<br/>query(args : Array) : ResultSet<br/>query : ResultSet<br/>query(*args) : ResultSet</span>
|
||||
query</a>,
|
||||
|
||||
|
||||
<a href="../DB/StatementMethods.html#scalar%28%2Aargs%29-instance-method" class="tooltip">
|
||||
<span>scalar(*args)</span>
|
||||
scalar</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/Disposable.html">DB::Disposable</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#close-instance-method" class="tooltip">
|
||||
<span>close</span>
|
||||
close</a>,
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#closed%3F-instance-method" class="tooltip">
|
||||
<span>closed?</span>
|
||||
closed?</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(connection:Connection)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(connection : <a href="../DB/Connection.html">Connection</a>)
|
||||
|
||||
<a class="method-permalink" href="#new%28connection%3AConnection%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L58" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="exec(args:Array)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>exec</strong>(args : Array)
|
||||
|
||||
<a class="method-permalink" href="#exec%28args%3AArray%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L71" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="exec-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>exec</strong>
|
||||
|
||||
<a class="method-permalink" href="#exec-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L66" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="exec(*args)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>exec</strong>(*args)
|
||||
|
||||
<a class="method-permalink" href="#exec%28%2Aargs%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L76" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query(args:Array)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query</strong>(args : Array)
|
||||
|
||||
<a class="method-permalink" href="#query%28args%3AArray%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L87" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query</strong>
|
||||
|
||||
<a class="method-permalink" href="#query-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L82" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query(*args)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query</strong>(*args)
|
||||
|
||||
<a class="method-permalink" href="#query%28%2Aargs%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L92" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="release_connection-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>release_connection</strong>
|
||||
|
||||
<a class="method-permalink" href="#release_connection-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L61" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
534
api/0.4.4/DB/StatementMethods.html
Normal file
534
api/0.4.4/DB/StatementMethods.html
Normal file
|
@ -0,0 +1,534 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::StatementMethods - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">module</span> DB::StatementMethods
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Common interface for connection based statements
|
||||
and for connection pool statements.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Included Modules</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/Disposable.html">DB::Disposable</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Direct including types</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/PoolStatement.html">DB::PoolStatement</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/Statement.html">DB::Statement</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L4" target="_blank">db/statement.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#exec%28args%3AArray%29%3AExecResult-instance-method" class="signature"><strong>#exec</strong>(args : Array) : ExecResult</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#exec%3AExecResult-instance-method" class="signature"><strong>#exec</strong> : ExecResult</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#exec%28%2Aargs%29%3AExecResult-instance-method" class="signature"><strong>#exec</strong>(*args) : ExecResult</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28%2Aargs%2C%26block%29-instance-method" class="signature"><strong>#query</strong>(*args, &block)</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28args%3AArray%29%3AResultSet-instance-method" class="signature"><strong>#query</strong>(args : Array) : ResultSet</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%3AResultSet-instance-method" class="signature"><strong>#query</strong> : ResultSet</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28%2Aargs%29%3AResultSet-instance-method" class="signature"><strong>#query</strong>(*args) : ResultSet</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#scalar%28%2Aargs%29-instance-method" class="signature"><strong>#scalar</strong>(*args)</a>
|
||||
|
||||
<div class="summary"><p>See <code><a href="../DB/QueryMethods.html#scalar%28query%2C%2Aargs%29-instance-method">QueryMethods#scalar</a></code></p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/Disposable.html">DB::Disposable</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#close-instance-method" class="tooltip">
|
||||
<span>close</span>
|
||||
close</a>,
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#closed%3F-instance-method" class="tooltip">
|
||||
<span>closed?</span>
|
||||
closed?</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="exec(args:Array):ExecResult-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>exec</strong>(args : Array) : <a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
<a class="method-permalink" href="#exec%28args%3AArray%29%3AExecResult-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L32" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="exec:ExecResult-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>exec</strong> : <a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
<a class="method-permalink" href="#exec%3AExecResult-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L28" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="exec(*args):ExecResult-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>exec</strong>(*args) : <a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
<a class="method-permalink" href="#exec%28%2Aargs%29%3AExecResult-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#exec%28query%2C%2Aargs%29-instance-method">QueryMethods#exec</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L30" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query(*args,&block)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>query</strong>(*args, &block)
|
||||
|
||||
<a class="method-permalink" href="#query%28%2Aargs%2C%26block%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L22" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query(args:Array):ResultSet-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>query</strong>(args : Array) : <a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
<a class="method-permalink" href="#query%28args%3AArray%29%3AResultSet-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L39" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query:ResultSet-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>query</strong> : <a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
<a class="method-permalink" href="#query%3AResultSet-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L35" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="query(*args):ResultSet-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>query</strong>(*args) : <a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
<a class="method-permalink" href="#query%28%2Aargs%29%3AResultSet-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#query%28query%2C%2Aargs%29-instance-method">QueryMethods#query</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L37" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="scalar(*args)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>scalar</strong>(*args)
|
||||
|
||||
<a class="method-permalink" href="#scalar%28%2Aargs%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>See <code><a href="../DB/QueryMethods.html#scalar%28query%2C%2Aargs%29-instance-method">QueryMethods#scalar</a></code></p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/statement.cr#L11" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
374
api/0.4.4/DB/StringKeyCache.html
Normal file
374
api/0.4.4/DB/StringKeyCache.html
Normal file
|
@ -0,0 +1,374 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::StringKeyCache(T) - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::StringKeyCache(T)
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/StringKeyCache.html">DB::StringKeyCache(T)</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/string_key_cache.cr#L2" target="_blank">db/string_key_cache.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#clear-instance-method" class="signature"><strong>#clear</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#each_value%28%26block%29-instance-method" class="signature"><strong>#each_value</strong>(&block)</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#fetch%28key%3AString%2C%26block%29%3AT-instance-method" class="signature"><strong>#fetch</strong>(key : String, &block) : T</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="clear-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>clear</strong>
|
||||
|
||||
<a class="method-permalink" href="#clear-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/string_key_cache.cr#L17" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="each_value(&block)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>each_value</strong>(&block)
|
||||
|
||||
<a class="method-permalink" href="#each_value%28%26block%29-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/string_key_cache.cr#L11" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="fetch(key:String,&block):T-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>fetch</strong>(key : String, &block) : T
|
||||
|
||||
<a class="method-permalink" href="#fetch%28key%3AString%2C%26block%29%3AT-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/string_key_cache.cr#L5" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
506
api/0.4.4/DB/TopLevelTransaction.html
Normal file
506
api/0.4.4/DB/TopLevelTransaction.html
Normal file
|
@ -0,0 +1,506 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::TopLevelTransaction - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">class</span> DB::TopLevelTransaction
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/TopLevelTransaction.html">DB::TopLevelTransaction</a></li><li class="superclass"><a href="../DB/Transaction.html">DB::Transaction</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L38" target="_blank">db/transaction.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Constructors</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28connection%3AConnection%29-class-method" class="signature"><strong>.new</strong>(connection : Connection)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#begin_transaction%3ATransaction-instance-method" class="signature"><strong>#begin_transaction</strong> : Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#commit-instance-method" class="signature"><strong>#commit</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#connection%3ADB%3A%3AConnection-instance-method" class="signature"><strong>#connection</strong> : DB::Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#rollback-instance-method" class="signature"><strong>#rollback</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from class <code><a href="../DB/Transaction.html">DB::Transaction</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/Transaction.html#commit-instance-method" class="tooltip">
|
||||
<span>commit</span>
|
||||
commit</a>,
|
||||
|
||||
|
||||
<a href="../DB/Transaction.html#connection%3AConnection-instance-method" class="tooltip">
|
||||
<span>connection : Connection</span>
|
||||
connection</a>,
|
||||
|
||||
|
||||
<a href="../DB/Transaction.html#release_from_nested_transaction-instance-method" class="tooltip">
|
||||
<span>release_from_nested_transaction</span>
|
||||
release_from_nested_transaction</a>,
|
||||
|
||||
|
||||
<a href="../DB/Transaction.html#rollback-instance-method" class="tooltip">
|
||||
<span>rollback</span>
|
||||
rollback</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/BeginTransaction.html">DB::BeginTransaction</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/BeginTransaction.html#begin_transaction%3ATransaction-instance-method" class="tooltip">
|
||||
<span>begin_transaction : Transaction</span>
|
||||
begin_transaction</a>,
|
||||
|
||||
|
||||
<a href="../DB/BeginTransaction.html#transaction%28%26block%29-instance-method" class="tooltip">
|
||||
<span>transaction(&block)</span>
|
||||
transaction</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/Disposable.html">DB::Disposable</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#close-instance-method" class="tooltip">
|
||||
<span>close</span>
|
||||
close</a>,
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#closed%3F-instance-method" class="tooltip">
|
||||
<span>closed?</span>
|
||||
closed?</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Constructor Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="new(connection:Connection)-class-method">
|
||||
<div class="signature">
|
||||
|
||||
def self.<strong>new</strong>(connection : <a href="../DB/Connection.html">Connection</a>)
|
||||
|
||||
<a class="method-permalink" href="#new%28connection%3AConnection%29-class-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L43" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="begin_transaction:Transaction-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>begin_transaction</strong> : <a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
<a class="method-permalink" href="#begin_transaction%3ATransaction-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L62" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="commit-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>commit</strong>
|
||||
|
||||
<a class="method-permalink" href="#commit-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L48" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="connection:DB::Connection-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>connection</strong> : <a href="../DB/Connection.html">DB::Connection</a>
|
||||
|
||||
<a class="method-permalink" href="#connection%3ADB%3A%3AConnection-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L39" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="rollback-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>rollback</strong>
|
||||
|
||||
<a class="method-permalink" href="#rollback-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L53" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
483
api/0.4.4/DB/Transaction.html
Normal file
483
api/0.4.4/DB/Transaction.html
Normal file
|
@ -0,0 +1,483 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="../js/doc.js"></script>
|
||||
<title>DB::Transaction - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li><a href="../index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent open current" data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="../DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="../DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="../DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="../DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="../DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="../DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="../DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="../DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="../DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="../DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="../DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="../DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="../DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="../DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="../DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="../DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="../DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="../DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="../DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="../DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="../DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="../DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="../DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="../DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="../DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="../DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="../DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="../DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="../DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="../DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="../DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="../DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" current" data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="../DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<h1 class="type-name">
|
||||
|
||||
<span class="kind">abstract class</span> DB::Transaction
|
||||
|
||||
</h1>
|
||||
|
||||
|
||||
<ul class="superclass-hierarchy"><li class="superclass"><a href="../DB/Transaction.html">DB::Transaction</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Transactions should be started from <code>DB#transaction</code>, <code>Connection#transaction</code>
|
||||
or <code><a href="../DB/Connection.html#begin_transaction-instance-method">Connection#begin_transaction</a></code>.</p>
|
||||
|
||||
<p>Use <code><a href="../DB/Transaction.html#connection%3AConnection-instance-method">Transaction#connection</a></code> to submit statements to the database.</p>
|
||||
|
||||
<p>Use <code><a href="../DB/Transaction.html#commit-instance-method">Transaction#commit</a></code> or <code><a href="../DB/Transaction.html#rollback-instance-method">Transaction#rollback</a></code> to close the ongoing transaction
|
||||
explicitly. Or refer to <code><a href="../DB/BeginTransaction.html#transaction%28%26block%29-instance-method">BeginTransaction#transaction</a></code> for documentation on how to
|
||||
use <code>#transaction(&block)</code> methods in <code><a href="../DB.html">DB</a></code> and <code><a href="../DB/Connection.html">Connection</a></code>.</p>
|
||||
|
||||
<p>Nested transactions are supported by using sql <code>SAVEPOINT</code>. To start a nested
|
||||
transaction use <code>Transaction#transaction</code> or <code>Transaction#begin_transaction</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Included Modules</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/BeginTransaction.html">DB::BeginTransaction</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/Disposable.html">DB::Disposable</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Direct Known Subclasses</h2>
|
||||
<ul class="other-types-list">
|
||||
|
||||
<li class="other-type"><a href="../DB/SavePointTransaction.html">DB::SavePointTransaction</a></li>
|
||||
|
||||
<li class="other-type"><a href="../DB/TopLevelTransaction.html">DB::TopLevelTransaction</a></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Defined in:</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L14" target="_blank">db/transaction.cr</a>
|
||||
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul class="list-summary">
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#commit-instance-method" class="signature"><strong>#commit</strong></a>
|
||||
|
||||
<div class="summary"><p>commits the current transaction</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#connection%3AConnection-instance-method" class="signature"><strong>#connection</strong> : Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#release_from_nested_transaction-instance-method" class="signature"><strong>#release_from_nested_transaction</strong></a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#rollback-instance-method" class="signature"><strong>#rollback</strong></a>
|
||||
|
||||
<div class="summary"><p>rollbacks the current transaction</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="methods-inherited">
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/BeginTransaction.html">DB::BeginTransaction</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/BeginTransaction.html#begin_transaction%3ATransaction-instance-method" class="tooltip">
|
||||
<span>begin_transaction : Transaction</span>
|
||||
begin_transaction</a>,
|
||||
|
||||
|
||||
<a href="../DB/BeginTransaction.html#transaction%28%26block%29-instance-method" class="tooltip">
|
||||
<span>transaction(&block)</span>
|
||||
transaction</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Instance methods inherited from module <code><a href="../DB/Disposable.html">DB::Disposable</a></code></h3>
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#close-instance-method" class="tooltip">
|
||||
<span>close</span>
|
||||
close</a>,
|
||||
|
||||
|
||||
<a href="../DB/Disposable.html#closed%3F-instance-method" class="tooltip">
|
||||
<span>closed?</span>
|
||||
closed?</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail" id="commit-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>commit</strong>
|
||||
|
||||
<a class="method-permalink" href="#commit-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>commits the current transaction</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L21" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="connection:Connection-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>connection</strong> : <a href="../DB/Connection.html">Connection</a>
|
||||
|
||||
<a class="method-permalink" href="#connection%3AConnection-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L18" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="release_from_nested_transaction-instance-method">
|
||||
<div class="signature">
|
||||
abstract
|
||||
def <strong>release_from_nested_transaction</strong>
|
||||
|
||||
<a class="method-permalink" href="#release_from_nested_transaction-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L35" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="rollback-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>rollback</strong>
|
||||
|
||||
<a class="method-permalink" href="#rollback-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>rollbacks the current transaction</p></div>
|
||||
|
||||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-lang/crystal-db/blob/790b587e3fdf7678743c7bc0e96d5878f82baebe/src/db/transaction.cr#L26" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
432
api/0.4.4/css/style.css
Normal file
432
api/0.4.4/css/style.css
Normal file
|
@ -0,0 +1,432 @@
|
|||
html, body {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "Avenir", "Tahoma", "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #263F6C;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: #112750;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin: 35px 0 25px;
|
||||
color: #444444;
|
||||
}
|
||||
|
||||
h1.type-name {
|
||||
color: #47266E;
|
||||
margin: 20px 0 30px;
|
||||
background-color: #F8F8F8;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid #EBEBEB;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
border-bottom: 1px solid #E6E6E6;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
#types-list, #main-content {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#types-list {
|
||||
left: 0;
|
||||
width: 20%;
|
||||
background-color: #2E1052;
|
||||
padding: 0 0 30px;
|
||||
box-shadow: inset -3px 0 4px rgba(0,0,0,.35);
|
||||
}
|
||||
|
||||
#types-list #search-box {
|
||||
padding: 8px 9px;
|
||||
}
|
||||
|
||||
#types-list input {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 5px;
|
||||
font: inherit;
|
||||
font-family: inherit;
|
||||
line-height: 1.2;
|
||||
width: 100%;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0px 3px 5px rgba(0,0,0,.25);
|
||||
transition: box-shadow .12s;
|
||||
}
|
||||
|
||||
#types-list input:focus {
|
||||
box-shadow: 0px 5px 6px rgba(0,0,0,.5);
|
||||
}
|
||||
|
||||
#types-list input::-webkit-input-placeholder { /* Chrome/Opera/Safari */
|
||||
color: #C8C8C8;
|
||||
font-size: 14px;
|
||||
text-indent: 2px;
|
||||
}
|
||||
|
||||
#types-list input::-moz-placeholder { /* Firefox 19+ */
|
||||
color: #C8C8C8;
|
||||
font-size: 14px;
|
||||
text-indent: 2px;
|
||||
}
|
||||
|
||||
#types-list input:-ms-input-placeholder { /* IE 10+ */
|
||||
color: #C8C8C8;
|
||||
font-size: 14px;
|
||||
text-indent: 2px;
|
||||
}
|
||||
|
||||
#types-list input:-moz-placeholder { /* Firefox 18- */
|
||||
color: #C8C8C8;
|
||||
font-size: 14px;
|
||||
text-indent: 2px;
|
||||
}
|
||||
|
||||
#types-list ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none outside;
|
||||
}
|
||||
|
||||
#types-list li {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#types-list li.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#types-list a {
|
||||
display: block;
|
||||
padding: 5px 15px 5px 30px;
|
||||
text-decoration: none;
|
||||
color: #F8F4FD;
|
||||
transition: color .14s;
|
||||
}
|
||||
|
||||
#types-list a:focus {
|
||||
outline: 1px solid #D1B7F1;
|
||||
}
|
||||
|
||||
#types-list .current > a,
|
||||
#types-list a:hover {
|
||||
color: #866BA6;
|
||||
}
|
||||
|
||||
#types-list li ul {
|
||||
overflow: hidden;
|
||||
height: 0;
|
||||
max-height: 0;
|
||||
transition: 1s ease-in-out;
|
||||
}
|
||||
|
||||
|
||||
#types-list li.parent {
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
#types-list li.parent::before {
|
||||
box-sizing: border-box;
|
||||
content: "▼";
|
||||
display: block;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
color: white;
|
||||
font-size: 8px;
|
||||
line-height: 30px;
|
||||
transform: rotateZ(-90deg);
|
||||
cursor: pointer;
|
||||
transition: .2s linear;
|
||||
}
|
||||
|
||||
|
||||
#types-list li.parent > a {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
#types-list li.parent.open::before {
|
||||
transform: rotateZ(0);
|
||||
}
|
||||
|
||||
#types-list li.open > ul {
|
||||
height: auto;
|
||||
max-height: 1000em;
|
||||
}
|
||||
|
||||
#main-content {
|
||||
padding: 0 30px 30px 30px;
|
||||
left: 20%;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.kind {
|
||||
font-size: 60%;
|
||||
color: #866BA6;
|
||||
}
|
||||
|
||||
.superclass-hierarchy {
|
||||
margin: -15px 0 30px 0;
|
||||
padding: 0;
|
||||
list-style: none outside;
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
.superclass-hierarchy .superclass {
|
||||
display: inline-block;
|
||||
margin: 0 7px 0 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.superclass-hierarchy .superclass + .superclass::before {
|
||||
content: "<";
|
||||
margin-right: 7px;
|
||||
}
|
||||
|
||||
.other-types-list li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.other-types-list,
|
||||
.list-summary {
|
||||
margin: 0 0 30px 0;
|
||||
padding: 0;
|
||||
list-style: none outside;
|
||||
}
|
||||
|
||||
.entry-const {
|
||||
font-family: Consolas, 'Courier New', Courier, Monaco, monospace;
|
||||
}
|
||||
|
||||
.entry-summary {
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
.superclass-hierarchy .superclass a,
|
||||
.other-type a,
|
||||
.entry-summary .signature {
|
||||
padding: 4px 8px;
|
||||
margin-bottom: 4px;
|
||||
display: inline-block;
|
||||
background-color: #f8f8f8;
|
||||
color: #47266E;
|
||||
border: 1px solid #f0f0f0;
|
||||
text-decoration: none;
|
||||
border-radius: 3px;
|
||||
font-family: Consolas, 'Courier New', Courier, Monaco, monospace;
|
||||
transition: background .15s, border-color .15s;
|
||||
}
|
||||
|
||||
.superclass-hierarchy .superclass a:hover,
|
||||
.other-type a:hover,
|
||||
.entry-summary .signature:hover {
|
||||
background: #D5CAE3;
|
||||
border-color: #624288;
|
||||
}
|
||||
|
||||
.entry-summary .summary {
|
||||
padding-left: 32px;
|
||||
}
|
||||
|
||||
.entry-summary .summary p {
|
||||
margin: 12px 0 16px;
|
||||
}
|
||||
|
||||
.entry-summary a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.entry-detail {
|
||||
padding: 30px 0;
|
||||
}
|
||||
|
||||
.entry-detail .signature {
|
||||
position: relative;
|
||||
padding: 5px 15px;
|
||||
margin-bottom: 10px;
|
||||
display: block;
|
||||
border-radius: 5px;
|
||||
background-color: #f8f8f8;
|
||||
color: #47266E;
|
||||
border: 1px solid #f0f0f0;
|
||||
font-family: Consolas, 'Courier New', Courier, Monaco, monospace;
|
||||
transition: .2s ease-in-out;
|
||||
}
|
||||
|
||||
.entry-detail:target .signature {
|
||||
background-color: #D5CAE3;
|
||||
border: 1px solid #624288;
|
||||
}
|
||||
|
||||
.entry-detail .signature .method-permalink {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -35px;
|
||||
padding: 5px 15px;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
color: #624288;
|
||||
opacity: .4;
|
||||
transition: opacity .2s;
|
||||
}
|
||||
|
||||
.entry-detail .signature .method-permalink:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.entry-detail:target .signature .method-permalink {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.methods-inherited {
|
||||
padding-right: 10%;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
.methods-inherited h3 {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.methods-inherited a {
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
color: #47266E;
|
||||
}
|
||||
|
||||
.methods-inherited a:hover {
|
||||
text-decoration: underline;
|
||||
color: #6C518B;
|
||||
}
|
||||
|
||||
.methods-inherited .tooltip>span {
|
||||
background: #D5CAE3;
|
||||
padding: 4px 8px;
|
||||
border-radius: 3px;
|
||||
margin: -4px -8px;
|
||||
}
|
||||
|
||||
.methods-inherited .tooltip * {
|
||||
color: #47266E;
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 10px 20px;
|
||||
margin-top: 4px;
|
||||
border-radius: 3px;
|
||||
line-height: 1.45;
|
||||
overflow: auto;
|
||||
color: #333;
|
||||
background: #fdfdfd;
|
||||
font-size: 14px;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: Consolas, 'Courier New', Courier, Monaco, monospace;
|
||||
}
|
||||
|
||||
span.flag {
|
||||
padding: 2px 4px 1px;
|
||||
border-radius: 3px;
|
||||
margin-right: 3px;
|
||||
font-size: 11px;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
span.flag.orange {
|
||||
background-color: #EE8737;
|
||||
color: #FCEBDD;
|
||||
border-color: #EB7317;
|
||||
}
|
||||
|
||||
span.flag.yellow {
|
||||
background-color: #E4B91C;
|
||||
color: #FCF8E8;
|
||||
border-color: #B69115;
|
||||
}
|
||||
|
||||
span.flag.green {
|
||||
background-color: #469C14;
|
||||
color: #E2F9D3;
|
||||
border-color: #34700E;
|
||||
}
|
||||
|
||||
span.flag.red {
|
||||
background-color: #BF1919;
|
||||
color: #F9ECEC;
|
||||
border-color: #822C2C;
|
||||
}
|
||||
|
||||
span.flag.purple {
|
||||
background-color: #2E1052;
|
||||
color: #ECE1F9;
|
||||
border-color: #1F0B37;
|
||||
}
|
||||
|
||||
.tooltip>span {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
display: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.tooltip:hover>span {
|
||||
display: inline-block;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.c {
|
||||
color: #969896;
|
||||
}
|
||||
|
||||
.n {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.t {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.s {
|
||||
color: #183691;
|
||||
}
|
||||
|
||||
.i {
|
||||
color: #7f5030;
|
||||
}
|
||||
|
||||
.k {
|
||||
color: #a71d5d;
|
||||
}
|
||||
|
||||
.o {
|
||||
color: #a71d5d;
|
||||
}
|
||||
|
||||
.m {
|
||||
color: #795da3;
|
||||
}
|
290
api/0.4.4/index.html
Normal file
290
api/0.4.4/index.html
Normal file
|
@ -0,0 +1,290 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta id="repository-name" content="github.com/crystal-lang/crystal-db">
|
||||
<link href="css/style.css" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="js/doc.js"></script>
|
||||
<title>README - github.com/crystal-lang/crystal-db</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="types-list">
|
||||
<div id="search-box">
|
||||
<input type="search" id="search-input" placeholder="Search...">
|
||||
</div>
|
||||
|
||||
<ul>
|
||||
<li class="current"><a href="index.html">README</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB" data-name="db">
|
||||
<a href="DB.html">DB</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Any" data-name="db::any">
|
||||
<a href="DB/Any.html">Any</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/BeginTransaction" data-name="db::begintransaction">
|
||||
<a href="DB/BeginTransaction.html">BeginTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Connection" data-name="db::connection">
|
||||
<a href="DB/Connection.html">Connection</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionContext" data-name="db::connectioncontext">
|
||||
<a href="DB/ConnectionContext.html">ConnectionContext</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionLost" data-name="db::connectionlost">
|
||||
<a href="DB/ConnectionLost.html">ConnectionLost</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ConnectionRefused" data-name="db::connectionrefused">
|
||||
<a href="DB/ConnectionRefused.html">ConnectionRefused</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Database" data-name="db::database">
|
||||
<a href="DB/Database.html">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Disposable" data-name="db::disposable">
|
||||
<a href="DB/Disposable.html">Disposable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Driver" data-name="db::driver">
|
||||
<a href="DB/Driver.html">Driver</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs" data-name="db::driverspecs(dbanytype)">
|
||||
<a href="DB/DriverSpecs.html">DriverSpecs</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/DriverSpecs/ColumnDef" data-name="db::driverspecs::columndef">
|
||||
<a href="DB/DriverSpecs/ColumnDef.html">ColumnDef</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Error" data-name="db::error">
|
||||
<a href="DB/Error.html">Error</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ExecResult" data-name="db::execresult">
|
||||
<a href="DB/ExecResult.html">ExecResult</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Mappable" data-name="db::mappable">
|
||||
<a href="DB/Mappable.html">Mappable</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/MappingException" data-name="db::mappingexception">
|
||||
<a href="DB/MappingException.html">MappingException</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/Pool" data-name="db::pool(t)">
|
||||
<a href="DB/Pool.html">Pool</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Pool/TimeoutHelper" data-name="db::pool::timeouthelper">
|
||||
<a href="DB/Pool/TimeoutHelper.html">TimeoutHelper</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolPreparedStatement" data-name="db::poolpreparedstatement">
|
||||
<a href="DB/PoolPreparedStatement.html">PoolPreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolRetryAttemptsExceeded" data-name="db::poolretryattemptsexceeded">
|
||||
<a href="DB/PoolRetryAttemptsExceeded.html">PoolRetryAttemptsExceeded</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolStatement" data-name="db::poolstatement">
|
||||
<a href="DB/PoolStatement.html">PoolStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolTimeout" data-name="db::pooltimeout">
|
||||
<a href="DB/PoolTimeout.html">PoolTimeout</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/PoolUnpreparedStatement" data-name="db::poolunpreparedstatement">
|
||||
<a href="DB/PoolUnpreparedStatement.html">PoolUnpreparedStatement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/QueryMethods" data-name="db::querymethods">
|
||||
<a href="DB/QueryMethods.html">QueryMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/ResultSet" data-name="db::resultset">
|
||||
<a href="DB/ResultSet.html">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Rollback" data-name="db::rollback">
|
||||
<a href="DB/Rollback.html">Rollback</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SavePointTransaction" data-name="db::savepointtransaction">
|
||||
<a href="DB/SavePointTransaction.html">SavePointTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="parent " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods" data-name="db::sessionmethods(session, stmt)">
|
||||
<a href="DB/SessionMethods.html">SessionMethods</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/PreparedQuery" data-name="db::sessionmethods::preparedquery(session, stmt)">
|
||||
<a href="DB/SessionMethods/PreparedQuery.html">PreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/SessionMethods/UnpreparedQuery" data-name="db::sessionmethods::unpreparedquery(session, stmt)">
|
||||
<a href="DB/SessionMethods/UnpreparedQuery.html">UnpreparedQuery</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Statement" data-name="db::statement">
|
||||
<a href="DB/Statement.html">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StatementMethods" data-name="db::statementmethods">
|
||||
<a href="DB/StatementMethods.html">StatementMethods</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/StringKeyCache" data-name="db::stringkeycache(t)">
|
||||
<a href="DB/StringKeyCache.html">StringKeyCache</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/TopLevelTransaction" data-name="db::topleveltransaction">
|
||||
<a href="DB/TopLevelTransaction.html">TopLevelTransaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class=" " data-id="github.com/crystal-lang/crystal-db/DB/Transaction" data-name="db::transaction">
|
||||
<a href="DB/Transaction.html">Transaction</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="main-content">
|
||||
<p><a href="https://travis-ci.org/crystal-lang/crystal-db" target="_blank"><img src="https://travis-ci.org/crystal-lang/crystal-db.svg?branch=master" alt="Build Status"/></a></p>
|
||||
|
||||
<h1>crystal-db</h1>
|
||||
|
||||
<p>Common db api for crystal. You will need to a specific driver to access a database.</p>
|
||||
|
||||
<ul><li><a href="https://github.com/crystal-lang/crystal-sqlite3" target="_blank">sqlite</a></li><li><a href="https://github.com/crystal-lang/crystal-mysql" target="_blank">mysql</a></li><li><a href="https://github.com/will/crystal-pg" target="_blank">postgres</a></li></ul>
|
||||
|
||||
<h2>Installation</h2>
|
||||
|
||||
<p>Add this to your application's <code>shard.yml</code>:</p>
|
||||
|
||||
<pre><code class='language-yaml'>dependencies:
|
||||
db:
|
||||
github: crystal-lang/crystal-db</code></pre>
|
||||
|
||||
<h2>Documentation</h2>
|
||||
|
||||
<ul><li><a href="http://crystal-lang.github.io/crystal-db/api/latest/" target="_blank">Latest API</a></li><li><a href="https://crystal-lang.org/docs/database/" target="_blank">Crystal book</a></li></ul>
|
||||
|
||||
<h2>Usage</h2>
|
||||
|
||||
<p>Since this is an abstract db api, it's usage is through a concrete database driver.</p>
|
||||
|
||||
<pre><code class='language-crystal'><span class="k">require</span> <span class="s">"db"</span>
|
||||
<span class="k">require</span> <span class="s">"sqlite3"</span>
|
||||
|
||||
<span class="t">DB</span>.open <span class="s">"sqlite3:./file.db"</span> <span class="k">do</span> <span class="o">|</span>db<span class="o">|</span>
|
||||
<span class="c"># When using the pg driver, use $1, $2, etc. instead of ?</span>
|
||||
db.exec <span class="s">"create table contacts (name text, age integer)"</span>
|
||||
db.exec <span class="s">"insert into contacts values (?, ?)"</span>, <span class="s">"John Doe"</span>, <span class="n">30</span>
|
||||
|
||||
args <span class="o">=</span> <span class="o">[]</span> <span class="k">of</span> <span class="t">DB</span><span class="t">::</span><span class="t">Any</span>
|
||||
args <span class="o"><<</span> <span class="s">"Sarah"</span>
|
||||
args <span class="o"><<</span> <span class="n">33</span>
|
||||
db.exec <span class="s">"insert into contacts values (?, ?)"</span>, args
|
||||
|
||||
puts <span class="s">"max age:"</span>
|
||||
puts db.scalar <span class="s">"select max(age) from contacts"</span> <span class="c"># => 33</span>
|
||||
|
||||
puts <span class="s">"contacts:"</span>
|
||||
db.query <span class="s">"select name, age from contacts order by age desc"</span> <span class="k">do</span> <span class="o">|</span>rs<span class="o">|</span>
|
||||
puts <span class="s">"</span><span class="i">#{</span></span>rs.column_name(<span class="n">0</span>)<span class="s"><span class="i">}</span> (</span><span class="i">#{</span></span>rs.column_name(<span class="n">1</span>)<span class="s"><span class="i">}</span>)"</span>
|
||||
<span class="c"># => name (age)</span>
|
||||
rs.each <span class="k">do</span>
|
||||
puts <span class="s">"</span><span class="i">#{</span></span>rs.read(<span class="t">String</span>)<span class="s"><span class="i">}</span> (</span><span class="i">#{</span></span>rs.read(<span class="t">Int32</span>)<span class="s"><span class="i">}</span>)"</span>
|
||||
<span class="c"># => Sarah (33)</span>
|
||||
<span class="c"># => John Doe (30)</span>
|
||||
<span class="k">end</span>
|
||||
<span class="k">end</span>
|
||||
<span class="k">end</span></code></pre>
|
||||
|
||||
<h2>Roadmap</h2>
|
||||
|
||||
<p>Issues not yet addressed</p>
|
||||
|
||||
<ul><li>[x] Support non prepared statements. <a href="https://github.com/crystal-lang/crystal-db/pull/25" target="_blank">#25</a></li><li>[x] Time data type. (implementation details depends on actual drivers)</li><li>[x] Data type extensibility. Allow each driver to extend the data types allowed.</li><li>[x] Transactions & nested transactions. <a href="https://github.com/crystal-lang/crystal-db/pull/27" target="_blank">#27</a></li><li>[x] Connection pool.</li><li>[ ] Direct access to <code>IO</code> to avoid memory allocation for blobs.</li></ul>
|
||||
|
||||
<h2>Contributing</h2>
|
||||
|
||||
<ol><li>Fork it ( https://github.com/crystal-lang/crystal-db/fork )</li><li>Create your feature branch (git checkout -b my-new-feature)</li><li>Commit your changes (git commit -am 'Add some feature')</li><li>Push to the branch (git push origin my-new-feature)</li><li>Create a new Pull Request</li></ol>
|
||||
|
||||
<h2>Contributors</h2>
|
||||
|
||||
<ul><li><a href="https://github.com/bcardiff" target="_blank">bcardiff</a> Brian J. Cardiff - creator, maintainer</li></ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
1
api/0.4.4/index.json
Normal file
1
api/0.4.4/index.json
Normal file
File diff suppressed because one or more lines are too long
111
api/0.4.4/js/doc.js
Normal file
111
api/0.4.4/js/doc.js
Normal file
|
@ -0,0 +1,111 @@
|
|||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var sessionStorage;
|
||||
try {
|
||||
sessionStorage = window.sessionStorage;
|
||||
} catch (e) { }
|
||||
if(!sessionStorage) {
|
||||
sessionStorage = {
|
||||
setItem: function() {},
|
||||
getItem: function() {},
|
||||
removeItem: function() {}
|
||||
};
|
||||
}
|
||||
|
||||
var repositoryName = document.getElementById('repository-name').getAttribute('content');
|
||||
var typesList = document.getElementById('types-list');
|
||||
var searchInput = document.getElementById('search-input');
|
||||
var parents = document.querySelectorAll('#types-list li.parent');
|
||||
|
||||
for(var i = 0; i < parents.length; i++) {
|
||||
var _parent = parents[i];
|
||||
_parent.addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
|
||||
if(e.target.tagName.toLowerCase() == 'li') {
|
||||
if(e.target.className.match(/open/)) {
|
||||
sessionStorage.removeItem(e.target.getAttribute('data-id'));
|
||||
e.target.className = e.target.className.replace(/ +open/g, '');
|
||||
} else {
|
||||
sessionStorage.setItem(e.target.getAttribute('data-id'), '1');
|
||||
if(e.target.className.indexOf('open') == -1) {
|
||||
e.target.className += ' open';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(sessionStorage.getItem(_parent.getAttribute('data-id')) == '1') {
|
||||
_parent.className += ' open';
|
||||
}
|
||||
};
|
||||
|
||||
var childMatch = function(type, regexp){
|
||||
var types = type.querySelectorAll("ul li");
|
||||
for (var j = 0; j < types.length; j ++) {
|
||||
var t = types[j];
|
||||
if(regexp.exec(t.getAttribute('data-name'))){ return true; };
|
||||
};
|
||||
return false;
|
||||
};
|
||||
|
||||
var searchTimeout;
|
||||
var performSearch = function() {
|
||||
clearTimeout(searchTimeout);
|
||||
searchTimeout = setTimeout(function() {
|
||||
var text = searchInput.value;
|
||||
var types = document.querySelectorAll('#types-list li');
|
||||
var words = text.toLowerCase().split(/\s+/).filter(function(word) {
|
||||
return word.length > 0;
|
||||
});
|
||||
var regexp = new RegExp(words.join('|'));
|
||||
|
||||
for(var i = 0; i < types.length; i++) {
|
||||
var type = types[i];
|
||||
if(words.length == 0 || regexp.exec(type.getAttribute('data-name')) || childMatch(type, regexp)) {
|
||||
type.className = type.className.replace(/ +hide/g, '');
|
||||
var is_parent = new RegExp("parent").exec(type.className);
|
||||
var is_not_opened = !(new RegExp("open").exec(type.className));
|
||||
if(childMatch(type,regexp) && is_parent && is_not_opened){
|
||||
type.className += " open";
|
||||
};
|
||||
} else {
|
||||
if(type.className.indexOf('hide') == -1) {
|
||||
type.className += ' hide';
|
||||
};
|
||||
};
|
||||
if(words.length == 0){
|
||||
type.className = type.className.replace(/ +open/g, '');
|
||||
};
|
||||
}
|
||||
}, 200);
|
||||
};
|
||||
if (searchInput.value.length > 0) {
|
||||
performSearch();
|
||||
}
|
||||
searchInput.addEventListener('keyup', performSearch);
|
||||
searchInput.addEventListener('input', performSearch);
|
||||
|
||||
typesList.onscroll = function() {
|
||||
var y = typesList.scrollTop;
|
||||
sessionStorage.setItem(repositoryName + '::types-list:scrollTop', y);
|
||||
};
|
||||
|
||||
var initialY = parseInt(sessionStorage.getItem(repositoryName + '::types-list:scrollTop') + "", 10);
|
||||
if(initialY > 0) {
|
||||
typesList.scrollTop = initialY;
|
||||
}
|
||||
|
||||
var scrollToEntryFromLocationHash = function() {
|
||||
var hash = window.location.hash;
|
||||
if (hash) {
|
||||
var targetAnchor = unescape(hash.substr(1));
|
||||
var targetEl = document.querySelectorAll('.entry-detail[id="' + targetAnchor + '"]');
|
||||
|
||||
if (targetEl && targetEl.length > 0) {
|
||||
targetEl[0].offsetParent.scrollTop = targetEl[0].offsetTop;
|
||||
}
|
||||
}
|
||||
};
|
||||
window.addEventListener("hashchange", scrollToEntryFromLocationHash, false);
|
||||
scrollToEntryFromLocationHash();
|
||||
});
|
Loading…
Reference in a new issue