mirror of
https://gitea.invidious.io/iv-org/shard-crystal-sqlite3.git
synced 2024-08-15 00:53:26 +00:00
Docs
This commit is contained in:
commit
888aff86c5
11 changed files with 1799 additions and 0 deletions
43
SQLite3.html
Normal file
43
SQLite3.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="css/style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<h1>module SQLite3</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
520
SQLite3/Database.html
Normal file
520
SQLite3/Database.html
Normal file
|
@ -0,0 +1,520 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<h1>class SQLite3::Database</h1>
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>The Database class encapsulates single connection to an SQLite3 database. Its usage is very straightforward:</p>
|
||||
|
||||
<pre><code><span class="k">require</span> <span class="s">"sqlite3"</span>
|
||||
|
||||
db <span class="o">=</span> <span class="t">SQLite3</span><span class="t">::</span><span class="t">Database</span>.<span class="k">new</span>( <span class="s">"data.db"</span> )
|
||||
db.execute(<span class="s">"select * from table"</span>) <span class="k">do</span> <span class="o">|</span>row<span class="o">|</span>
|
||||
p row
|
||||
<span class="k">end</span>
|
||||
db.close</code></pre>
|
||||
|
||||
<p>Lower level methods are also provided.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Superclass hierarchy</h2>
|
||||
<div style="padding-left: 0px">Object</div><div style="padding-left: 20px">Reference</div><div style="padding-left: 40px"><a href="../SQLite3/Database.html">SQLite3::Database</a></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Class Method Summary</h2>
|
||||
<ul>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28filename%2C%20%26block%29-class-method" class="signature"><strong>.new</strong>(filename, &block)</a>
|
||||
|
||||
<div class="summary"><p>Creates a new Database object that opens the given file, yields it, and closes it at the end.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28filename%29-class-method" class="signature"><strong>.new</strong>(filename)</a>
|
||||
|
||||
<div class="summary"><p>Creates a new Database object that opens the given file.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#close-instance-method" class="signature"><strong>#close</strong></a>
|
||||
|
||||
<div class="summary"><p>Closes this database.</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 database instance has been closed (see <code><a href="../SQLite3/Database.html#close-instance-method">#close</a></code>).</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#execute%28sql%2C%20%2Abinds%2C%20%26block%29-instance-method" class="signature"><strong>#execute</strong>(sql, *binds, &block)</a>
|
||||
|
||||
<div class="summary"><p>Executes the given SQL statement.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#execute%28sql%2C%20binds%20%3A%20Enumerable%29-instance-method" class="signature"><strong>#execute</strong>(sql, binds : Enumerable)</a>
|
||||
|
||||
<div class="summary"><p>Executes the given SQL statement.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#execute%28sql%2C%20%2Abinds%29-instance-method" class="signature"><strong>#execute</strong>(sql, *binds)</a>
|
||||
|
||||
<div class="summary"><p>Executes the given SQL statement.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#execute%28sql%2C%20binds%20%3A%20Enumerable%2C%20%26block%29-instance-method" class="signature"><strong>#execute</strong>(sql, binds : Enumerable, &block)</a>
|
||||
|
||||
<div class="summary"><p>Executes the given SQL statement.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#get_first_row%28sql%2C%20binds%20%3A%20Enumerable%29-instance-method" class="signature"><strong>#get_first_row</strong>(sql, binds : Enumerable)</a>
|
||||
|
||||
<div class="summary"><p>A convenience method that returns the first row of a query result.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#get_first_row%28sql%2C%20%2Abinds%29-instance-method" class="signature"><strong>#get_first_row</strong>(sql, *binds)</a>
|
||||
|
||||
<div class="summary"><p>A convenience method that returns the first row of a query result.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#get_first_value%28sql%2C%20binds%20%3A%20Enumerable%29-instance-method" class="signature"><strong>#get_first_value</strong>(sql, binds : Enumerable)</a>
|
||||
|
||||
<div class="summary"><p>A convenience method that returns the first value of the first row of a query result.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#get_first_value%28sql%2C%20%2Abinds%29-instance-method" class="signature"><strong>#get_first_value</strong>(sql, *binds)</a>
|
||||
|
||||
<div class="summary"><p>A convenience method that returns the first value of the first row of a query result.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#last_insert_row_id-instance-method" class="signature"><strong>#last_insert_row_id</strong></a>
|
||||
|
||||
<div class="summary"><p>Obtains the unique row ID of the last row to be inserted by this Database instance.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#prepare%28sql%29-instance-method" class="signature"><strong>#prepare</strong>(sql)</a>
|
||||
|
||||
<div class="summary"><p>Prepares an sql statement.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28sql%2C%20binds%20%3A%20Enumerable%29-instance-method" class="signature"><strong>#query</strong>(sql, binds : Enumerable)</a>
|
||||
|
||||
<div class="summary"><p>Executes a query and gives back a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28sql%2C%20%2Abinds%29-instance-method" class="signature"><strong>#query</strong>(sql, *binds)</a>
|
||||
|
||||
<div class="summary"><p>Executes a query and gives back a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28sql%2C%20%2Abinds%2C%20%26block%29-instance-method" class="signature"><strong>#query</strong>(sql, *binds, &block)</a>
|
||||
|
||||
<div class="summary"><p>Executes a query and yields a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code> that will be closed at the end of the given block.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#query%28sql%2C%20binds%20%3A%20Enumerable%2C%20%26block%29-instance-method" class="signature"><strong>#query</strong>(sql, binds : Enumerable, &block)</a>
|
||||
|
||||
<div class="summary"><p>Executes a query and yields a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code> that will be closed at the end of the given block.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#quote%28string%29-instance-method" class="signature"><strong>#quote</strong>(string)</a>
|
||||
|
||||
<div class="summary"><p>Quotes the given string, making it safe to use in an SQL statement.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Class Method Detail</h2>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="new%28filename%2C%20%26block%29-class-method">
|
||||
|
||||
def self.<strong>new</strong>(filename, &block)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Creates a new Database object that opens the given file, yields it, and closes it at the end.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L25" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="new%28filename%29-class-method">
|
||||
|
||||
def self.<strong>new</strong>(filename)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Creates a new Database object that opens the given file.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L16" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="close-instance-method">
|
||||
|
||||
def <strong>close</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Closes this database.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L167" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="closed%3F-instance-method">
|
||||
|
||||
def <strong>closed?</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns <code>true</code> if this database instance has been closed (see <code><a href="../SQLite3/Database.html#close-instance-method">#close</a></code>).</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L162" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="execute%28sql%2C%20%2Abinds%2C%20%26block%29-instance-method">
|
||||
|
||||
def <strong>execute</strong>(sql, *binds, &block)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes the given SQL statement. If additional parameters are given, they are treated as bind variables,
|
||||
and are bound to the placeholders in the query.</p>
|
||||
|
||||
<p>Note that if any of the values passed to this are hashes, then the key/value pairs are each bound separately,
|
||||
with the key being used as the name of the placeholder to bind the value to.</p>
|
||||
|
||||
<p>Yields one <code>Array(<a href="../SQLite3/Value.html">Value</a>)</code> for each result.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L52" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="execute%28sql%2C%20binds%20%3A%20Enumerable%29-instance-method">
|
||||
|
||||
def <strong>execute</strong>(sql, binds : Enumerable)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes the given SQL statement. If additional parameters are given, they are treated as bind variables,
|
||||
and are bound to the placeholders in the query.</p>
|
||||
|
||||
<p>Note that if any of the values passed to this are hashes, then the key/value pairs are each bound separately,
|
||||
with the key being used as the name of the placeholder to bind the value to.</p>
|
||||
|
||||
<p>Returns an <code>Array(Array(<a href="../SQLite3/Value.html">Value</a>))</code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L65" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="execute%28sql%2C%20%2Abinds%29-instance-method">
|
||||
|
||||
def <strong>execute</strong>(sql, *binds)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes the given SQL statement. If additional parameters are given, they are treated as bind variables,
|
||||
and are bound to the placeholders in the query.</p>
|
||||
|
||||
<p>Note that if any of the values passed to this are hashes, then the key/value pairs are each bound separately,
|
||||
with the key being used as the name of the placeholder to bind the value to.</p>
|
||||
|
||||
<p>Returns an <code>Array(Array(<a href="../SQLite3/Value.html">Value</a>))</code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L41" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="execute%28sql%2C%20binds%20%3A%20Enumerable%2C%20%26block%29-instance-method">
|
||||
|
||||
def <strong>execute</strong>(sql, binds : Enumerable, &block)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes the given SQL statement. If additional parameters are given, they are treated as bind variables,
|
||||
and are bound to the placeholders in the query.</p>
|
||||
|
||||
<p>Note that if any of the values passed to this are hashes, then the key/value pairs are each bound separately,
|
||||
with the key being used as the name of the placeholder to bind the value to.</p>
|
||||
|
||||
<p>Yields one <code>Array(<a href="../SQLite3/Value.html">Value</a>)</code> for each result.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L80" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="get_first_row%28sql%2C%20binds%20%3A%20Enumerable%29-instance-method">
|
||||
|
||||
def <strong>get_first_row</strong>(sql, binds : Enumerable)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>A convenience method that returns the first row of a query result.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L94" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="get_first_row%28sql%2C%20%2Abinds%29-instance-method">
|
||||
|
||||
def <strong>get_first_row</strong>(sql, *binds)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>A convenience method that returns the first row of a query result.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L89" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="get_first_value%28sql%2C%20binds%20%3A%20Enumerable%29-instance-method">
|
||||
|
||||
def <strong>get_first_value</strong>(sql, binds : Enumerable)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>A convenience method that returns the first value of the first row of a query result.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L110" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="get_first_value%28sql%2C%20%2Abinds%29-instance-method">
|
||||
|
||||
def <strong>get_first_value</strong>(sql, *binds)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>A convenience method that returns the first value of the first row of a query result.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L105" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="last_insert_row_id-instance-method">
|
||||
|
||||
def <strong>last_insert_row_id</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Obtains the unique row ID of the last row to be inserted by this Database instance.
|
||||
This is an <code>Int64</code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L151" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="prepare%28sql%29-instance-method">
|
||||
|
||||
def <strong>prepare</strong>(sql)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Prepares an sql statement. Returns a <code><a href="../SQLite3/Statement.html">Statement</a></code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L145" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="query%28sql%2C%20binds%20%3A%20Enumerable%29-instance-method">
|
||||
|
||||
def <strong>query</strong>(sql, binds : Enumerable)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a query and gives back a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L133" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="query%28sql%2C%20%2Abinds%29-instance-method">
|
||||
|
||||
def <strong>query</strong>(sql, *binds)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a query and gives back a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L121" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="query%28sql%2C%20%2Abinds%2C%20%26block%29-instance-method">
|
||||
|
||||
def <strong>query</strong>(sql, *binds, &block)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a query and yields a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code> that will be closed at the end of the given block.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L126" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="query%28sql%2C%20binds%20%3A%20Enumerable%2C%20%26block%29-instance-method">
|
||||
|
||||
def <strong>query</strong>(sql, binds : Enumerable, &block)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes a query and yields a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code> that will be closed at the end of the given block.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L138" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="quote%28string%29-instance-method">
|
||||
|
||||
def <strong>quote</strong>(string)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Quotes the given string, making it safe to use in an SQL statement.
|
||||
It replaces all instances of the single-quote character with two single-quote characters.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/database.cr#L157" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
106
SQLite3/Exception.html
Normal file
106
SQLite3/Exception.html
Normal file
|
@ -0,0 +1,106 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<h1>class SQLite3::Exception</h1>
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>Exception thrown on invalid SQLite3 operations.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Superclass hierarchy</h2>
|
||||
<div style="padding-left: 0px">Object</div><div style="padding-left: 20px">Reference</div><div style="padding-left: 40px">Exception</div><div style="padding-left: 60px"><a href="../SQLite3/Exception.html">SQLite3::Exception</a></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Class Method Summary</h2>
|
||||
<ul>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#new%28db%29-class-method" class="signature"><strong>.new</strong>(db)</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#code-instance-method" class="signature"><strong>#code</strong></a>
|
||||
|
||||
<div class="summary"><p>The internal code associated with the failure.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Class Method Detail</h2>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="new%28db%29-class-method">
|
||||
|
||||
def self.<strong>new</strong>(db)
|
||||
</div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/exception.cr#L6" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="code-instance-method">
|
||||
|
||||
def <strong>code</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>The internal code associated with the failure.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/exception.cr#L4" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
250
SQLite3/ResultSet.html
Normal file
250
SQLite3/ResultSet.html
Normal file
|
@ -0,0 +1,250 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<h1>class SQLite3::ResultSet</h1>
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>The ResultSet object encapsulates the enumerability of a query’s output.
|
||||
It is a simple cursor over the data that the query returns.</p>
|
||||
|
||||
<p>Typical usage is:</p>
|
||||
|
||||
<pre><code><span class="k">require</span> <span class="s">"sqlite3"</span>
|
||||
|
||||
db <span class="o">=</span> <span class="t">SQLite3</span><span class="t">::</span><span class="t">Database</span>.<span class="k">new</span>(<span class="s">"foo.db"</span>)
|
||||
stmt <span class="o">=</span> db.prepare(<span class="s">"select * from person"</span>)
|
||||
result_set <span class="o">=</span> stmt.execute
|
||||
<span class="k">while</span> result_set.<span class="k">next</span>
|
||||
p result_set.to_a
|
||||
<span class="k">end</span>
|
||||
stmt.close
|
||||
db.close</code></pre>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Superclass hierarchy</h2>
|
||||
<div style="padding-left: 0px">Object</div><div style="padding-left: 20px">Reference</div><div style="padding-left: 40px"><a href="../SQLite3/ResultSet.html">SQLite3::ResultSet</a></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#%5B%5D%28index_or_name%29-instance-method" class="signature"><strong>#[]</strong>(index_or_name)</a>
|
||||
|
||||
<div class="summary"><p>Returns the value of a column by index or name.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#close-instance-method" class="signature"><strong>#close</strong></a>
|
||||
|
||||
<div class="summary"><p>Closes this result set, closing the associated statement.</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 the associated statement is closed.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#column_count-instance-method" class="signature"><strong>#column_count</strong></a>
|
||||
|
||||
<div class="summary"><p>Returns the number of columns.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#columns-instance-method" class="signature"><strong>#columns</strong></a>
|
||||
|
||||
<div class="summary"><p>Returns the names of the columns, an <code>Array(String)</code>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#next-instance-method" class="signature"><strong>#next</strong></a>
|
||||
|
||||
<div class="summary"><p>Advances to the next row.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#to_a-instance-method" class="signature"><strong>#to_a</strong></a>
|
||||
|
||||
<div class="summary"><p>Return the current row's value as an <code>Array(<a href="../SQLite3/Value.html">Value</a>)</code>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#types-instance-method" class="signature"><strong>#types</strong></a>
|
||||
|
||||
<div class="summary"><p>Returns the types of the columns, an <code>Array(<a href="../SQLite3/Type.html">Type</a>)</code>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="%5B%5D%28index_or_name%29-instance-method">
|
||||
|
||||
def <strong>[]</strong>(index_or_name)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the value of a column by index or name.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/result_set.cr#L29" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="close-instance-method">
|
||||
|
||||
def <strong>close</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Closes this result set, closing the associated statement.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/result_set.cr#L58" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="closed%3F-instance-method">
|
||||
|
||||
def <strong>closed?</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns <code>true</code> if the associated statement is closed.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/result_set.cr#L63" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="column_count-instance-method">
|
||||
|
||||
def <strong>column_count</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the number of columns.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/result_set.cr#L24" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="columns-instance-method">
|
||||
|
||||
def <strong>columns</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the names of the columns, an <code>Array(String)</code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/result_set.cr#L39" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="next-instance-method">
|
||||
|
||||
def <strong>next</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Advances to the next row. Returns <code>true</code> if there's a next row,
|
||||
<code>false</code> otherwise. Must be called at least once to advance to the first
|
||||
row.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/result_set.cr#L46" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="to_a-instance-method">
|
||||
|
||||
def <strong>to_a</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Return the current row's value as an <code>Array(<a href="../SQLite3/Value.html">Value</a>)</code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/result_set.cr#L68" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="types-instance-method">
|
||||
|
||||
def <strong>types</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the types of the columns, an <code>Array(<a href="../SQLite3/Type.html">Type</a>)</code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/result_set.cr#L34" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
568
SQLite3/Statement.html
Normal file
568
SQLite3/Statement.html
Normal file
|
@ -0,0 +1,568 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<h1>class SQLite3::Statement</h1>
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>A statement represents a prepared-but-unexecuted SQL query.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Superclass hierarchy</h2>
|
||||
<div style="padding-left: 0px">Object</div><div style="padding-left: 20px">Reference</div><div style="padding-left: 40px"><a href="../SQLite3/Statement.html">SQLite3::Statement</a></div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Summary</h2>
|
||||
<ul>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#%5B%5D%28index%20%3A%20Int%29-instance-method" class="signature"><strong>#[]</strong>(index : Int)</a>
|
||||
|
||||
<div class="summary"><p>Returns the value of the given column by index (1-based).</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#%5B%5D%28name%20%3A%20String%29-instance-method" class="signature"><strong>#[]</strong>(name : String)</a>
|
||||
|
||||
<div class="summary"><p>Returns the value of the given column by name.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#%5B%5D%3D%28index%20%3A%20Int%2C%20value%20%3A%20Int64%29-instance-method" class="signature"><strong>#[]=</strong>(index : Int, value : Int64)</a>
|
||||
|
||||
<div class="summary"><p>Binds the parameter at the given index to an Int64.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#%5B%5D%3D%28index%20%3A%20Int%2C%20value%20%3A%20Int32%29-instance-method" class="signature"><strong>#[]=</strong>(index : Int, value : Int32)</a>
|
||||
|
||||
<div class="summary"><p>Binds the parameter at the given index to an Int32.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#%5B%5D%3D%28index%20%3A%20Int%2C%20value%20%3A%20Nil%29-instance-method" class="signature"><strong>#[]=</strong>(index : Int, value : Nil)</a>
|
||||
|
||||
<div class="summary"><p>Binds the parameter at the given index to an Int.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#%5B%5D%3D%28name%20%3A%20String%20%7C%20Symbol%2C%20value%29-instance-method" class="signature"><strong>#[]=</strong>(name : String | Symbol, value)</a>
|
||||
|
||||
<div class="summary"><p>Binds a named parameter, using the <code>:AAAA</code> naming scheme for parameters.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#%5B%5D%3D%28index%20%3A%20Int%2C%20hash%20%3A%20Hash%29-instance-method" class="signature"><strong>#[]=</strong>(index : Int, hash : Hash)</a>
|
||||
|
||||
<div class="summary"><p>Binds a hash to this statement (the <code>index</code> is ignored).</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#%5B%5D%3D%28index%20%3A%20Int%2C%20value%20%3A%20Slice%28UInt8%29%29-instance-method" class="signature"><strong>#[]=</strong>(index : Int, value : Slice(UInt8))</a>
|
||||
|
||||
<div class="summary"><p>Binds the parameter at the given index to a BLOB.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#%5B%5D%3D%28index%20%3A%20Int%2C%20value%20%3A%20Float%29-instance-method" class="signature"><strong>#[]=</strong>(index : Int, value : Float)</a>
|
||||
|
||||
<div class="summary"><p>Binds the parameter at the given index to a Float.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#%5B%5D%3D%28index%20%3A%20Int%2C%20value%20%3A%20String%29-instance-method" class="signature"><strong>#[]=</strong>(index : Int, value : String)</a>
|
||||
|
||||
<div class="summary"><p>Binds the parameter at the given index to a String.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#close-instance-method" class="signature"><strong>#close</strong></a>
|
||||
|
||||
<div class="summary"><p>Closes this statement.</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 statement is closed.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#column_count-instance-method" class="signature"><strong>#column_count</strong></a>
|
||||
|
||||
<div class="summary"><p>Returns the number of columns in this statement.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#column_name%28index%29-instance-method" class="signature"><strong>#column_name</strong>(index)</a>
|
||||
|
||||
<div class="summary"><p>Returns the name of the column at the given index.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#column_type%28index%20%3A%20Int%29-instance-method" class="signature"><strong>#column_type</strong>(index : Int)</a>
|
||||
|
||||
<div class="summary"><p>Returns the <code><a href="../SQLite3/Type.html">Type</a></code> of the column at the given index.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#columns-instance-method" class="signature"><strong>#columns</strong></a>
|
||||
|
||||
<div class="summary"><p>Returns the column names of this statement.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#execute%28%2Abinds%2C%20%26block%29-instance-method" class="signature"><strong>#execute</strong>(*binds, &block)</a>
|
||||
|
||||
<div class="summary"><p>Executes this statement with the given binds and yields a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code> that will be closed at the end of the block.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#execute%28binds%20%3A%20Enumerable%20%7C%20Slice%28UInt8%29%2C%20%26block%29-instance-method" class="signature"><strong>#execute</strong>(binds : Enumerable | Slice(UInt8), &block)</a>
|
||||
|
||||
<div class="summary"><p>Executes this statement with the given binds and yields a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code> that will be closed at the end of the block.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#execute%28binds%20%3A%20Slice%28UInt8%29%29-instance-method" class="signature"><strong>#execute</strong>(binds : Slice(UInt8))</a>
|
||||
|
||||
<div class="summary"><p>Executes this statement with a single BLOB bind and returns a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#execute%28binds%20%3A%20Enumerable%29-instance-method" class="signature"><strong>#execute</strong>(binds : Enumerable)</a>
|
||||
|
||||
<div class="summary"><p>Executes this statement with the given binds and returns a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#execute%28%2Abinds%29-instance-method" class="signature"><strong>#execute</strong>(*binds)</a>
|
||||
|
||||
<div class="summary"><p>Executes this statement with the given binds and returns a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#reset-instance-method" class="signature"><strong>#reset</strong></a>
|
||||
|
||||
<div class="summary"><p>Reset this statment, allowing to re-execute it with new binds.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#types-instance-method" class="signature"><strong>#types</strong></a>
|
||||
|
||||
<div class="summary"><p>Returns an <code>Array(<a href="../SQLite3/Type.html">Type</a>)</code> of this statement's columns.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Instance Method Detail</h2>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="%5B%5D%28index%20%3A%20Int%29-instance-method">
|
||||
|
||||
def <strong>[]</strong>(index : Int)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the value of the given column by index (1-based).</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L78" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="%5B%5D%28name%20%3A%20String%29-instance-method">
|
||||
|
||||
def <strong>[]</strong>(name : String)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the value of the given column by name.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L100" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="%5B%5D%3D%28index%20%3A%20Int%2C%20value%20%3A%20Int64%29-instance-method">
|
||||
|
||||
def <strong>[]=</strong>(index : Int, value : Int64)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Binds the parameter at the given index to an Int64.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L120" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="%5B%5D%3D%28index%20%3A%20Int%2C%20value%20%3A%20Int32%29-instance-method">
|
||||
|
||||
def <strong>[]=</strong>(index : Int, value : Int32)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Binds the parameter at the given index to an Int32.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L115" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="%5B%5D%3D%28index%20%3A%20Int%2C%20value%20%3A%20Nil%29-instance-method">
|
||||
|
||||
def <strong>[]=</strong>(index : Int, value : Nil)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Binds the parameter at the given index to an Int.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L110" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="%5B%5D%3D%28name%20%3A%20String%20%7C%20Symbol%2C%20value%29-instance-method">
|
||||
|
||||
def <strong>[]=</strong>(name : String | Symbol, value)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Binds a named parameter, using the <code>:AAAA</code> naming scheme for parameters.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L140" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="%5B%5D%3D%28index%20%3A%20Int%2C%20hash%20%3A%20Hash%29-instance-method">
|
||||
|
||||
def <strong>[]=</strong>(index : Int, hash : Hash)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Binds a hash to this statement (the <code>index</code> is ignored).</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L150" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="%5B%5D%3D%28index%20%3A%20Int%2C%20value%20%3A%20Slice%28UInt8%29%29-instance-method">
|
||||
|
||||
def <strong>[]=</strong>(index : Int, value : Slice(UInt8))
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Binds the parameter at the given index to a BLOB.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L135" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="%5B%5D%3D%28index%20%3A%20Int%2C%20value%20%3A%20Float%29-instance-method">
|
||||
|
||||
def <strong>[]=</strong>(index : Int, value : Float)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Binds the parameter at the given index to a Float.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L125" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="%5B%5D%3D%28index%20%3A%20Int%2C%20value%20%3A%20String%29-instance-method">
|
||||
|
||||
def <strong>[]=</strong>(index : Int, value : String)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Binds the parameter at the given index to a String.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L130" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="close-instance-method">
|
||||
|
||||
def <strong>close</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Closes this statement.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L174" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="closed%3F-instance-method">
|
||||
|
||||
def <strong>closed?</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns <code>true</code> if this statement is closed. See <code><a href="../SQLite3/Statement.html#close-instance-method">#close</a></code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L182" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="column_count-instance-method">
|
||||
|
||||
def <strong>column_count</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the number of columns in this statement.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L25" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="column_name%28index%29-instance-method">
|
||||
|
||||
def <strong>column_name</strong>(index)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the name of the column at the given index.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L35" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="column_type%28index%20%3A%20Int%29-instance-method">
|
||||
|
||||
def <strong>column_type</strong>(index : Int)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the <code><a href="../SQLite3/Type.html">Type</a></code> of the column at the given index.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L30" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="columns-instance-method">
|
||||
|
||||
def <strong>columns</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns the column names of this statement.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L157" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="execute%28%2Abinds%2C%20%26block%29-instance-method">
|
||||
|
||||
def <strong>execute</strong>(*binds, &block)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes this statement with the given binds and yields a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code> that
|
||||
will be closed at the end of the block.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L46" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="execute%28binds%20%3A%20Enumerable%20%7C%20Slice%28UInt8%29%2C%20%26block%29-instance-method">
|
||||
|
||||
def <strong>execute</strong>(binds : Enumerable | Slice(UInt8), &block)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes this statement with the given binds and yields a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code> that
|
||||
will be closed at the end of the block.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L71" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="execute%28binds%20%3A%20Slice%28UInt8%29%29-instance-method">
|
||||
|
||||
def <strong>execute</strong>(binds : Slice(UInt8))
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes this statement with a single BLOB bind and returns a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L53" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="execute%28binds%20%3A%20Enumerable%29-instance-method">
|
||||
|
||||
def <strong>execute</strong>(binds : Enumerable)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes this statement with the given binds and returns a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L60" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="execute%28%2Abinds%29-instance-method">
|
||||
|
||||
def <strong>execute</strong>(*binds)
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Executes this statement with the given binds and returns a <code><a href="../SQLite3/ResultSet.html">ResultSet</a></code>.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L40" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="reset-instance-method">
|
||||
|
||||
def <strong>reset</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Reset this statment, allowing to re-execute it with new binds.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L169" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
<div class="entry-detail">
|
||||
<div class="signature" id="types-instance-method">
|
||||
|
||||
def <strong>types</strong>
|
||||
</div>
|
||||
|
||||
<div class="doc"><p>Returns an <code>Array(<a href="../SQLite3/Type.html">Type</a>)</code> of this statement's columns. Note that the statement
|
||||
must be executed in order for this to return sensible values, otherwise all types
|
||||
will be NULL.</p></div>
|
||||
|
||||
|
||||
<br/>
|
||||
<div>[<a href="https://github.com/manastech/crystal-sqlite3/blob/d62185867bf35fa946436da24de5e8aa6f1a6227/src/sqlite3/statement.cr#L164" target="_blank">View source</a>]</div>
|
||||
|
||||
</div>
|
||||
<hr/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
75
SQLite3/Type.html
Normal file
75
SQLite3/Type.html
Normal file
|
@ -0,0 +1,75 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<h1>enum SQLite3::Type</h1>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Enum Members</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="entry-const">
|
||||
<strong>INTEGER</strong> = <code><span class="n">1</span></code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-const">
|
||||
<strong>FLOAT</strong> = <code><span class="n">2</span></code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-const">
|
||||
<strong>BLOB</strong> = <code><span class="n">4</span></code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-const">
|
||||
<strong>NULL</strong> = <code><span class="n">5</span></code>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="entry-const">
|
||||
<strong>TEXT</strong> = <code><span class="n">3</span></code>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
50
SQLite3/Value.html
Normal file
50
SQLite3/Value.html
Normal file
|
@ -0,0 +1,50 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="../css/style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<h1>alias SQLite3::Value</h1>
|
||||
|
||||
|
||||
|
||||
<h2>Overview</h2>
|
||||
|
||||
<p>All possible values of each column of a row returned by <code><a href="../SQLite3/Database.html#execute%28sql%2C%20%2Abinds%2C%20%26block%29-instance-method">Database#execute</a></code>.</p>
|
||||
|
||||
|
||||
|
||||
<h2>Alias Definition</h2>
|
||||
<code>Nil | Int64 | Float64 | String | Slice(UInt8)</code>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
92
css/style.css
Normal file
92
css/style.css
Normal file
|
@ -0,0 +1,92 @@
|
|||
body {
|
||||
font-family: "Lucida Sans", "Lucida Grande", Verdana, Arial, sans-serif;
|
||||
}
|
||||
|
||||
.entry-summary {
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
|
||||
.entry-summary .signature {
|
||||
padding: 4px 8px;
|
||||
margin-bottom: 4px;
|
||||
display: inline-block;
|
||||
background: #f8f8f8;
|
||||
color: #05a;
|
||||
border: 1px solid #f0f0f0;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
}
|
||||
|
||||
.entry-summary .signature:hover {
|
||||
background: #CFEBFF;
|
||||
border-color: #A4CCDA;
|
||||
}
|
||||
|
||||
.entry-summary .summary {
|
||||
padding-left: 32px;
|
||||
}
|
||||
|
||||
.entry-summary a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.entry-detail .signature {
|
||||
padding: 6px 10px;
|
||||
margin-bottom: 10px;
|
||||
display: inline-block;
|
||||
background: #E8F4FF;
|
||||
border: 1px solid #d8d8e5
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
hr {
|
||||
color: #ddd;
|
||||
background-color: #ddd;
|
||||
height: 1px;
|
||||
border: 0;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 10px 20px;
|
||||
margin-top: 4px;
|
||||
border-radius: 3px;
|
||||
line-height: 1.45;
|
||||
overflow: auto;
|
||||
color: #333;
|
||||
background: #f7f7f7;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.c {
|
||||
color: #969896;
|
||||
}
|
||||
|
||||
.n {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.t {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.s {
|
||||
color: #183691;
|
||||
}
|
||||
|
||||
.i {
|
||||
color: #7f5030;
|
||||
}
|
||||
|
||||
.k {
|
||||
color: #a71d5d;
|
||||
}
|
||||
|
||||
.o {
|
||||
color: #a71d5d;
|
||||
}
|
||||
|
||||
.m {
|
||||
color: #795da3;
|
||||
}
|
10
index.html
Normal file
10
index.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link href="css/style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<frameset cols="20%,*">
|
||||
<frame name="list" src="list.html" />
|
||||
<frame name="main" src="main.html" />
|
||||
</frameset>
|
||||
</html>
|
53
list.html
Normal file
53
list.html
Normal file
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="css/style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<a href="SQLite3.html" target="main">SQLite3</a>
|
||||
|
||||
<ul>
|
||||
|
||||
<li>
|
||||
<a href="SQLite3/Database.html" target="main">Database</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="SQLite3/Exception.html" target="main">Exception</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="SQLite3/ResultSet.html" target="main">ResultSet</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="SQLite3/Statement.html" target="main">Statement</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="SQLite3/Type.html" target="main">Type</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="SQLite3/Value.html" target="main">Value</a>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
32
main.html
Normal file
32
main.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link href="css/style.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>crystal-sqlite3</h1>
|
||||
|
||||
<p>SQLite3 bindings for <a href="http://crystal-lang.org/" target="_blank">Crystal</a>.</p>
|
||||
|
||||
<p><strong>This is a work in progress.</strong></p>
|
||||
|
||||
<p><a href="http://manastech.github.io/crystal-sqlite3/" target="_blank">Documentation</a></p>
|
||||
|
||||
<h3>Projectfile</h3>
|
||||
|
||||
<pre><code>deps <span class="k">do</span>
|
||||
github <span class="s">"manastech/crystal-sqlite3"</span>
|
||||
<span class="k">end</span></code></pre>
|
||||
|
||||
<h3>Usage</h3>
|
||||
|
||||
<pre><code><span class="k">require</span> <span class="s">"sqlite3"</span>
|
||||
|
||||
db <span class="o">=</span> <span class="t">SQLite3</span><span class="t">::</span><span class="t">Database</span>.<span class="k">new</span>( <span class="s">"data.db"</span> )
|
||||
db.execute(<span class="s">"select * from table"</span>) <span class="k">do</span> <span class="o">|</span>row<span class="o">|</span>
|
||||
p row
|
||||
<span class="k">end</span>
|
||||
db.close</code></pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue