Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Created gh-pages branch via GitHub

  • Loading branch information...
commit 26489fc00500df343482e2c654d71ce5d7e2731e 0 parents
@ccgus authored
BIN  images/bg_hr.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/blacktocat.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/icon_download.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  images/sprite_download.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
265 index.html
@@ -0,0 +1,265 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <meta charset='utf-8' />
+ <meta http-equiv="X-UA-Compatible" content="chrome=1" />
+ <meta name="description" content="Fmdb : A Cocoa / Objective-C wrapper around SQLite" />
+
+ <link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
+
+ <title>Fmdb</title>
+ </head>
+
+ <body>
+
+ <!-- HEADER -->
+ <div id="header_wrap" class="outer">
+ <header class="inner">
+ <a id="forkme_banner" href="https://github.com/ccgus/fmdb">Fork Me on GitHub</a>
+
+ <h1 id="project_title">Fmdb</h1>
+ <h2 id="project_tagline">A Cocoa / Objective-C wrapper around SQLite</h2>
+
+ <section id="downloads">
+ <a class="zip_download_link" href="https://github.com/ccgus/fmdb/zipball/master">Download this project as a .zip file</a>
+ <a class="tar_download_link" href="https://github.com/ccgus/fmdb/tarball/master">Download this project as a tar.gz file</a>
+ </section>
+ </header>
+ </div>
+
+ <!-- MAIN CONTENT -->
+ <div id="main_content_wrap" class="outer">
+ <section id="main_content" class="inner">
+ <h1>FMDB</h1>
+
+<p>This is an Objective-C wrapper around SQLite: <a href="http://sqlite.org/">http://sqlite.org/</a></p>
+
+<h2>The FMDB Mailing List:</h2>
+
+<p><a href="http://groups.google.com/group/fmdb">http://groups.google.com/group/fmdb</a></p>
+
+<h2>Read the SQLite FAQ:</h2>
+
+<p><a href="http://www.sqlite.org/faq.html">http://www.sqlite.org/faq.html</a></p>
+
+<p>Since FMDB is built on top of SQLite, you're going to want to read this page top to bottom at least once. And while you're there, make sure to bookmark the SQLite Documentation page: <a href="http://www.sqlite.org/docs.html">http://www.sqlite.org/docs.html</a></p>
+
+<h2>Automatic Reference Counting (ARC) or Manual Memory Management?</h2>
+
+<p>You can use either style in your Cocoa project. FMDB Will figure out which you are using at compile time and do the right thing.</p>
+
+<h2>Usage</h2>
+
+<p>There are three main classes in FMDB:</p>
+
+<ol>
+<li>
+<code>FMDatabase</code> - Represents a single SQLite database. Used for executing SQL statements.</li>
+<li>
+<code>FMResultSet</code> - Represents the results of executing a query on an <code>FMDatabase</code>.</li>
+<li>
+<code>FMDatabaseQueue</code> - If you're wanting to perform queries and updates on multiple threads, you'll want to use this class. It's described in the "Thread Safety" section below.</li>
+</ol><h3>Database Creation</h3>
+
+<p>An <code>FMDatabase</code> is created with a path to a SQLite database file. This path can be one of these three:</p>
+
+<ol>
+<li>A file system path. The file does not have to exist on disk. If it does not exist, it is created for you.</li>
+<li>An empty string (<code>@""</code>). An empty database is created at a temporary location. This database is deleted with the <code>FMDatabase</code> connection is closed.</li>
+<li>
+<code>NULL</code>. An in-memory database is created. This database will be destroyed with the <code>FMDatabase</code> connection is closed.</li>
+</ol><p>(For more information on temporary and in-memory databases, read the sqlite documentation on the subject: <a href="http://www.sqlite.org/inmemorydb.html">http://www.sqlite.org/inmemorydb.html</a>)</p>
+
+<pre><code>FMDatabase *db = [FMDatabase databaseWithPath:@"/tmp/tmp.db"];
+</code></pre>
+
+<h3>Opening</h3>
+
+<p>Before you can interact with the database, it must be opened. Opening fails if there are insufficient resources or permissions to open and/or create the database.</p>
+
+<pre><code>if (![db open]) {
+ [db release];
+ return;
+}
+</code></pre>
+
+<h3>Executing Updates</h3>
+
+<p>Any sort of SQL statement which is not a <code>SELECT</code> statement qualifies as an update. This includes <code>CREATE</code>, <code>PRAGMA</code>, <code>UPDATE</code>, <code>INSERT</code>, <code>ALTER</code>, <code>COMMIT</code>, <code>BEGIN</code>, <code>DETACH</code>, <code>DELETE</code>, <code>DROP</code>, <code>END</code>, <code>EXPLAIN</code>, <code>VACUUM</code>, and <code>REPLACE</code> statements (plus many more). Basically, if your SQL statement does not begin with <code>SELECT</code>, it is an update statement.</p>
+
+<p>Executing updates returns a single value, a <code>BOOL</code>. A return value of <code>YES</code> means the update was successfully executed, and a return value of <code>NO</code> means that some error was encountered. If you use the <code>-[FMDatabase executeUpdate:error:withArgumentsInArray:orVAList:]</code> method to execute an update, you may supply an <code>NSError **</code> that will be filled in if execution fails. Otherwise you may invoke the <code>-lastErrorMessage</code> and <code>-lastErrorCode</code> methods to retrieve more information.</p>
+
+<h3>Executing Queries</h3>
+
+<p>A <code>SELECT</code> statement is a query and is executed via one of the <code>-executeQuery...</code> methods.</p>
+
+<p>Executing queries returns an <code>FMResultSet</code> object if successful, and <code>nil</code> upon failure. Like executing updates, there is a variant that accepts an <code>NSError **</code> parameter. Otherwise you should use the <code>-lastErrorMessage</code> and <code>-lastErrorCode</code> methods to determine why a query failed.</p>
+
+<p>In order to iterate through the results of your query, you use a <code>while()</code> loop. You also need to "step" from one record to the other. With FMDB, the easiest way to do that is like this:</p>
+
+<pre><code>FMResultSet *s = [db executeQuery:@"SELECT * FROM myTable"];
+while ([s next]) {
+ //retrieve values for each record
+}
+</code></pre>
+
+<p>You must always invoke <code>-[FMResultSet next]</code> before attempting to access the values returned in a query, even if you're only expecting one:</p>
+
+<pre><code>FMResultSet *s = [db executeQuery:@"SELECT COUNT(*) FROM myTable"];
+if ([s next]) {
+ int totalCount = [s intForColumnIndex:0];
+}
+</code></pre>
+
+<p><code>FMResultSet</code> has many methods to retrieve data in an appropriate format:</p>
+
+<ul>
+<li><code>intForColumn:</code></li>
+<li><code>longForColumn:</code></li>
+<li><code>longLongIntForColumn:</code></li>
+<li><code>boolForColumn:</code></li>
+<li><code>doubleForColumn:</code></li>
+<li><code>stringForColumn:</code></li>
+<li><code>dateForColumn:</code></li>
+<li><code>dataForColumn:</code></li>
+<li><code>dataNoCopyForColumn:</code></li>
+<li><code>UTF8StringForColumnIndex:</code></li>
+<li><code>objectForColumn:</code></li>
+</ul><p>Each of these methods also has a <code>{type}ForColumnIndex:</code> variant that is used to retrieve the data based on the position of the column in the results, as opposed to the column's name.</p>
+
+<p>Typically, there's no need to <code>-close</code> an <code>FMResultSet</code> yourself, since that happens when either the result set is deallocated, or the parent database is closed.</p>
+
+<h3>Closing</h3>
+
+<p>When you have finished executing queries and updates on the database, you should <code>-close</code> the <code>FMDatabase</code> connection so that SQLite will relinquish any resources it has acquired during the course of its operation.</p>
+
+<pre><code>[db close];
+</code></pre>
+
+<h3>Transactions</h3>
+
+<p><code>FMDatabase</code> can begin and commit a transaction by invoking one of the appropriate methods or executing a begin/end transaction statement.</p>
+
+<h3>Data Sanitization</h3>
+
+<p>When providing a SQL statement to FMDB, you should not attempt to "sanitize" any values before insertion. Instead, you should use the standard SQLite binding syntax:</p>
+
+<pre><code>INSERT INTO myTable VALUES (?, ?, ?)
+</code></pre>
+
+<p>The <code>?</code> character is recognized by SQLite as a placeholder for a value to be inserted. The execution methods all accept a variable number of arguments (or a representation of those arguments, such as an <code>NSArray</code>, <code>NSDictionary</code>, or a <code>va_list</code>), which are properly escaped for you.</p>
+
+<p>Alternatively, you may use named parameters syntax:</p>
+
+<pre><code>INSERT INTO myTable VALUES (:id, :name, :value)
+</code></pre>
+
+<p>The parameters <em>must</em> start with a colon. SQLite itself supports other characters, but internally the Dictionary keys are prefixed with a colon, do <strong>not</strong> include the colon in your dictionary keys.</p>
+
+<pre><code>NSDictionary *argsDict = [NSDictionary dictionaryWithObjectsAndKeys:@"My Name", @"name", nil];
+[db executeUpdate:@"INSERT INTO myTable (name) VALUES (:name)" withParameterDictionary:argsDict];
+</code></pre>
+
+<p>Thus, you SHOULD NOT do this (or anything like this):</p>
+
+<pre><code>[db executeUpdate:[NSString stringWithFormat:@"INSERT INTO myTable VALUES (%@)", @"this has \" lots of ' bizarre \" quotes '"]];
+</code></pre>
+
+<p>Instead, you SHOULD do:</p>
+
+<pre><code>[db executeUpdate:@"INSERT INTO myTable VALUES (?)", @"this has \" lots of ' bizarre \" quotes '"];
+</code></pre>
+
+<p>All arguments provided to the <code>-executeUpdate:</code> method (or any of the variants that accept a <code>va_list</code> as a parameter) must be objects. The following will not work (and will result in a crash):</p>
+
+<pre><code>[db executeUpdate:@"INSERT INTO myTable VALUES (?)", 42];
+</code></pre>
+
+<p>The proper way to insert a number is to box it in an <code>NSNumber</code> object:</p>
+
+<pre><code>[db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:42]];
+</code></pre>
+
+<p>Alternatively, you can use the <code>-execute*WithFormat:</code> variant to use <code>NSString</code>-style substitution:</p>
+
+<pre><code>[db executeUpdateWithFormat:@"INSERT INTO myTable VALUES (%d)", 42];
+</code></pre>
+
+<p>Internally, the <code>-execute*WithFormat:</code> methods are properly boxing things for you. The following percent modifiers are recognized: <code>%@</code>, <code>%c</code>, <code>%s</code>, <code>%d</code>, <code>%D</code>, <code>%i</code>, <code>%u</code>, <code>%U</code>, <code>%hi</code>, <code>%hu</code>, <code>%qi</code>, <code>%qu</code>, <code>%f</code>, <code>%g</code>, <code>%ld</code>, <code>%lu</code>, <code>%lld</code>, and <code>%llu</code>. Using a modifier other than those will have unpredictable results. If, for some reason, you need the <code>%</code> character to appear in your SQL statement, you should use <code>%%</code>.</p>
+
+<h2>Using FMDatabaseQueue and Thread Safety.</h2>
+
+<p>Using a single instance of FMDatabase from multiple threads at once is a bad idea. It has always been OK to make a FMDatabase object <em>per thread</em>. Just don't share a single instance across threads, and definitely not across multiple threads at the same time. Bad things will eventually happen and you'll eventually get something to crash, or maybe get an exception, or maybe meteorites will fall out of the sky and hit your Mac Pro. <em>This would suck</em>.</p>
+
+<p><strong>So don't instantiate a single FMDatabase object and use it across multiple threads.</strong></p>
+
+<p>Instead, use FMDatabaseQueue. It's your friend and it's here to help. Here's how to use it:</p>
+
+<p>First, make your queue.</p>
+
+<pre><code>FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:aPath];
+</code></pre>
+
+<p>Then use it like so:</p>
+
+<pre><code>[queue inDatabase:^(FMDatabase *db) {
+ [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:1]];
+ [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:2]];
+ [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:3]];
+
+ FMResultSet *rs = [db executeQuery:@"select * from foo"];
+ while ([rs next]) {
+ …
+ }
+}];
+</code></pre>
+
+<p>An easy way to wrap things up in a transaction can be done like this:</p>
+
+<pre><code>[queue inTransaction:^(FMDatabase *db, BOOL *rollback) {
+ [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:1]];
+ [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:2]];
+ [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:3]];
+
+ if (whoopsSomethingWrongHappened) {
+ *rollback = YES;
+ return;
+ }
+ // etc…
+ [db executeUpdate:@"INSERT INTO myTable VALUES (?)", [NSNumber numberWithInt:4]];
+}];
+</code></pre>
+
+<p>FMDatabaseQueue will make a serialized GCD queue in the background and execute the blocks you pass to the GCD queue. This means if you call your FMDatabaseQueue's methods from multiple threads at the same time GDC will execute them in the order they are received. This means queries and updates won't step on each other's toes, and every one is happy.</p>
+
+<h2>Making custom sqlite functions, based on blocks.</h2>
+
+<p>You can do this! For an example, look for "makeFunctionNamed:" in main.m</p>
+
+<h2>History</h2>
+
+<p>The history and changes are availbe on its <a href="https://github.com/ccgus/fmdb">GitHub page</a> and are summarized in the "CHANGES_AND_TODO_LIST.txt" file.</p>
+
+<h2>Contributors</h2>
+
+<p>The contributors to FMDB are contained in the "Contributors.txt" file.</p>
+
+<h2>License</h2>
+
+<p>The license for FMDB is contained in the "License.txt" file.</p>
+ </section>
+ </div>
+
+ <!-- FOOTER -->
+ <div id="footer_wrap" class="outer">
+ <footer class="inner">
+ <p class="copyright">Fmdb maintained by <a href="https://github.com/ccgus">ccgus</a></p>
+ <p>Published with <a href="http://pages.github.com">GitHub Pages</a></p>
+ </footer>
+ </div>
+
+
+
+ </body>
+</html>
1  javascripts/main.js
@@ -0,0 +1 @@
+console.log('This would be the main JS file.');
1  params.json
@@ -0,0 +1 @@
+{"name":"Fmdb","body":"# FMDB\r\nThis is an Objective-C wrapper around SQLite: http://sqlite.org/\r\n\r\n\r\n## The FMDB Mailing List:\r\nhttp://groups.google.com/group/fmdb\r\n\r\n## Read the SQLite FAQ:\r\nhttp://www.sqlite.org/faq.html\r\n\r\nSince FMDB is built on top of SQLite, you're going to want to read this page top to bottom at least once. And while you're there, make sure to bookmark the SQLite Documentation page: http://www.sqlite.org/docs.html\r\n\r\n## Automatic Reference Counting (ARC) or Manual Memory Management?\r\nYou can use either style in your Cocoa project. FMDB Will figure out which you are using at compile time and do the right thing.\r\n\r\n## Usage\r\nThere are three main classes in FMDB:\r\n\r\n1. `FMDatabase` - Represents a single SQLite database. Used for executing SQL statements.\r\n2. `FMResultSet` - Represents the results of executing a query on an `FMDatabase`.\r\n3. `FMDatabaseQueue` - If you're wanting to perform queries and updates on multiple threads, you'll want to use this class. It's described in the \"Thread Safety\" section below.\r\n\r\n### Database Creation\r\nAn `FMDatabase` is created with a path to a SQLite database file. This path can be one of these three:\r\n\r\n1. A file system path. The file does not have to exist on disk. If it does not exist, it is created for you.\r\n2. An empty string (`@\"\"`). An empty database is created at a temporary location. This database is deleted with the `FMDatabase` connection is closed.\r\n3. `NULL`. An in-memory database is created. This database will be destroyed with the `FMDatabase` connection is closed.\r\n\r\n(For more information on temporary and in-memory databases, read the sqlite documentation on the subject: http://www.sqlite.org/inmemorydb.html)\r\n\r\n\tFMDatabase *db = [FMDatabase databaseWithPath:@\"/tmp/tmp.db\"];\r\n\t\r\n### Opening\r\n\r\nBefore you can interact with the database, it must be opened. Opening fails if there are insufficient resources or permissions to open and/or create the database.\r\n\r\n\tif (![db open]) {\r\n\t\t[db release];\r\n\t\treturn;\r\n\t}\r\n\t\r\n### Executing Updates\r\n\r\nAny sort of SQL statement which is not a `SELECT` statement qualifies as an update. This includes `CREATE`, `PRAGMA`, `UPDATE`, `INSERT`, `ALTER`, `COMMIT`, `BEGIN`, `DETACH`, `DELETE`, `DROP`, `END`, `EXPLAIN`, `VACUUM`, and `REPLACE` statements (plus many more). Basically, if your SQL statement does not begin with `SELECT`, it is an update statement.\r\n\r\nExecuting updates returns a single value, a `BOOL`. A return value of `YES` means the update was successfully executed, and a return value of `NO` means that some error was encountered. If you use the `-[FMDatabase executeUpdate:error:withArgumentsInArray:orVAList:]` method to execute an update, you may supply an `NSError **` that will be filled in if execution fails. Otherwise you may invoke the `-lastErrorMessage` and `-lastErrorCode` methods to retrieve more information.\r\n\r\n### Executing Queries\r\n\r\nA `SELECT` statement is a query and is executed via one of the `-executeQuery...` methods.\r\n\r\nExecuting queries returns an `FMResultSet` object if successful, and `nil` upon failure. Like executing updates, there is a variant that accepts an `NSError **` parameter. Otherwise you should use the `-lastErrorMessage` and `-lastErrorCode` methods to determine why a query failed.\r\n\r\nIn order to iterate through the results of your query, you use a `while()` loop. You also need to \"step\" from one record to the other. With FMDB, the easiest way to do that is like this:\r\n\r\n\tFMResultSet *s = [db executeQuery:@\"SELECT * FROM myTable\"];\r\n\twhile ([s next]) {\r\n\t\t//retrieve values for each record\r\n\t}\r\n\t\r\nYou must always invoke `-[FMResultSet next]` before attempting to access the values returned in a query, even if you're only expecting one:\r\n\r\n\tFMResultSet *s = [db executeQuery:@\"SELECT COUNT(*) FROM myTable\"];\r\n\tif ([s next]) {\r\n\t\tint totalCount = [s intForColumnIndex:0];\r\n\t}\r\n\t\r\n`FMResultSet` has many methods to retrieve data in an appropriate format:\r\n\r\n- `intForColumn:`\r\n- `longForColumn:`\r\n- `longLongIntForColumn:`\r\n- `boolForColumn:`\r\n- `doubleForColumn:`\r\n- `stringForColumn:`\r\n- `dateForColumn:`\r\n- `dataForColumn:`\r\n- `dataNoCopyForColumn:`\r\n- `UTF8StringForColumnIndex:`\r\n- `objectForColumn:`\r\n\r\nEach of these methods also has a `{type}ForColumnIndex:` variant that is used to retrieve the data based on the position of the column in the results, as opposed to the column's name.\r\n\r\nTypically, there's no need to `-close` an `FMResultSet` yourself, since that happens when either the result set is deallocated, or the parent database is closed.\r\n\r\n### Closing\r\n\r\nWhen you have finished executing queries and updates on the database, you should `-close` the `FMDatabase` connection so that SQLite will relinquish any resources it has acquired during the course of its operation.\r\n\r\n\t[db close];\r\n\t\r\n### Transactions\r\n\r\n`FMDatabase` can begin and commit a transaction by invoking one of the appropriate methods or executing a begin/end transaction statement.\r\n\r\n### Data Sanitization\r\n\r\nWhen providing a SQL statement to FMDB, you should not attempt to \"sanitize\" any values before insertion. Instead, you should use the standard SQLite binding syntax:\r\n\r\n\tINSERT INTO myTable VALUES (?, ?, ?)\r\n\t\r\nThe `?` character is recognized by SQLite as a placeholder for a value to be inserted. The execution methods all accept a variable number of arguments (or a representation of those arguments, such as an `NSArray`, `NSDictionary`, or a `va_list`), which are properly escaped for you.\r\n\r\nAlternatively, you may use named parameters syntax:\r\n\r\n INSERT INTO myTable VALUES (:id, :name, :value)\r\n \r\nThe parameters *must* start with a colon. SQLite itself supports other characters, but internally the Dictionary keys are prefixed with a colon, do **not** include the colon in your dictionary keys.\r\n\r\n NSDictionary *argsDict = [NSDictionary dictionaryWithObjectsAndKeys:@\"My Name\", @\"name\", nil];\r\n [db executeUpdate:@\"INSERT INTO myTable (name) VALUES (:name)\" withParameterDictionary:argsDict];\r\n\r\nThus, you SHOULD NOT do this (or anything like this):\r\n\r\n\t[db executeUpdate:[NSString stringWithFormat:@\"INSERT INTO myTable VALUES (%@)\", @\"this has \\\" lots of ' bizarre \\\" quotes '\"]];\r\n\t\r\nInstead, you SHOULD do:\r\n\r\n\t[db executeUpdate:@\"INSERT INTO myTable VALUES (?)\", @\"this has \\\" lots of ' bizarre \\\" quotes '\"];\r\n\t\r\nAll arguments provided to the `-executeUpdate:` method (or any of the variants that accept a `va_list` as a parameter) must be objects. The following will not work (and will result in a crash):\r\n\r\n\t[db executeUpdate:@\"INSERT INTO myTable VALUES (?)\", 42];\r\n\t\r\nThe proper way to insert a number is to box it in an `NSNumber` object:\r\n\r\n\t[db executeUpdate:@\"INSERT INTO myTable VALUES (?)\", [NSNumber numberWithInt:42]];\r\n\t\r\nAlternatively, you can use the `-execute*WithFormat:` variant to use `NSString`-style substitution:\r\n\r\n\t[db executeUpdateWithFormat:@\"INSERT INTO myTable VALUES (%d)\", 42];\r\n\t\r\nInternally, the `-execute*WithFormat:` methods are properly boxing things for you. The following percent modifiers are recognized: `%@`, `%c`, `%s`, `%d`, `%D`, `%i`, `%u`, `%U`, `%hi`, `%hu`, `%qi`, `%qu`, `%f`, `%g`, `%ld`, `%lu`, `%lld`, and `%llu`. Using a modifier other than those will have unpredictable results. If, for some reason, you need the `%` character to appear in your SQL statement, you should use `%%`.\r\n\r\n\r\n<h2 id=\"threads\">Using FMDatabaseQueue and Thread Safety.</h2>\r\n\r\nUsing a single instance of FMDatabase from multiple threads at once is a bad idea. It has always been OK to make a FMDatabase object *per thread*. Just don't share a single instance across threads, and definitely not across multiple threads at the same time. Bad things will eventually happen and you'll eventually get something to crash, or maybe get an exception, or maybe meteorites will fall out of the sky and hit your Mac Pro. *This would suck*.\r\n\r\n**So don't instantiate a single FMDatabase object and use it across multiple threads.**\r\n\r\nInstead, use FMDatabaseQueue. It's your friend and it's here to help. Here's how to use it:\r\n\r\nFirst, make your queue.\r\n\r\n\tFMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:aPath];\r\n\r\nThen use it like so:\r\n\r\n [queue inDatabase:^(FMDatabase *db) {\r\n\t\t[db executeUpdate:@\"INSERT INTO myTable VALUES (?)\", [NSNumber numberWithInt:1]];\r\n\t\t[db executeUpdate:@\"INSERT INTO myTable VALUES (?)\", [NSNumber numberWithInt:2]];\r\n\t\t[db executeUpdate:@\"INSERT INTO myTable VALUES (?)\", [NSNumber numberWithInt:3]];\r\n\t\t\r\n\t\tFMResultSet *rs = [db executeQuery:@\"select * from foo\"];\r\n while ([rs next]) {\r\n …\r\n }\r\n }];\r\n\r\nAn easy way to wrap things up in a transaction can be done like this:\r\n\r\n [queue inTransaction:^(FMDatabase *db, BOOL *rollback) {\r\n [db executeUpdate:@\"INSERT INTO myTable VALUES (?)\", [NSNumber numberWithInt:1]];\r\n\t\t[db executeUpdate:@\"INSERT INTO myTable VALUES (?)\", [NSNumber numberWithInt:2]];\r\n\t\t[db executeUpdate:@\"INSERT INTO myTable VALUES (?)\", [NSNumber numberWithInt:3]];\r\n\t\t\r\n\t\tif (whoopsSomethingWrongHappened) {\r\n\t\t *rollback = YES;\r\n\t\t return;\r\n\t\t}\r\n\t\t// etc…\r\n\t\t[db executeUpdate:@\"INSERT INTO myTable VALUES (?)\", [NSNumber numberWithInt:4]];\r\n }];\r\n\r\n\r\nFMDatabaseQueue will make a serialized GCD queue in the background and execute the blocks you pass to the GCD queue. This means if you call your FMDatabaseQueue's methods from multiple threads at the same time GDC will execute them in the order they are received. This means queries and updates won't step on each other's toes, and every one is happy.\r\n\r\n## Making custom sqlite functions, based on blocks.\r\n\r\nYou can do this! For an example, look for \"makeFunctionNamed:\" in main.m\r\n\r\n## History\r\n\r\nThe history and changes are availbe on its [GitHub page](https://github.com/ccgus/fmdb) and are summarized in the \"CHANGES_AND_TODO_LIST.txt\" file.\r\n\r\n## Contributors\r\n\r\nThe contributors to FMDB are contained in the \"Contributors.txt\" file.\r\n\r\n## License\r\n\r\nThe license for FMDB is contained in the \"License.txt\" file.","tagline":"A Cocoa / Objective-C wrapper around SQLite","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}
70 stylesheets/pygment_trac.css
@@ -0,0 +1,70 @@
+.highlight .hll { background-color: #ffffcc }
+.highlight { background: #f0f3f3; }
+.highlight .c { color: #0099FF; font-style: italic } /* Comment */
+.highlight .err { color: #AA0000; background-color: #FFAAAA } /* Error */
+.highlight .k { color: #006699; font-weight: bold } /* Keyword */
+.highlight .o { color: #555555 } /* Operator */
+.highlight .cm { color: #0099FF; font-style: italic } /* Comment.Multiline */
+.highlight .cp { color: #009999 } /* Comment.Preproc */
+.highlight .c1 { color: #0099FF; font-style: italic } /* Comment.Single */
+.highlight .cs { color: #0099FF; font-weight: bold; font-style: italic } /* Comment.Special */
+.highlight .gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #FF0000 } /* Generic.Error */
+.highlight .gh { color: #003300; font-weight: bold } /* Generic.Heading */
+.highlight .gi { background-color: #CCFFCC; border: 1px solid #00CC00 } /* Generic.Inserted */
+.highlight .go { color: #AAAAAA } /* Generic.Output */
+.highlight .gp { color: #000099; font-weight: bold } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #003300; font-weight: bold } /* Generic.Subheading */
+.highlight .gt { color: #99CC66 } /* Generic.Traceback */
+.highlight .kc { color: #006699; font-weight: bold } /* Keyword.Constant */
+.highlight .kd { color: #006699; font-weight: bold } /* Keyword.Declaration */
+.highlight .kn { color: #006699; font-weight: bold } /* Keyword.Namespace */
+.highlight .kp { color: #006699 } /* Keyword.Pseudo */
+.highlight .kr { color: #006699; font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #007788; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #FF6600 } /* Literal.Number */
+.highlight .s { color: #CC3300 } /* Literal.String */
+.highlight .na { color: #330099 } /* Name.Attribute */
+.highlight .nb { color: #336666 } /* Name.Builtin */
+.highlight .nc { color: #00AA88; font-weight: bold } /* Name.Class */
+.highlight .no { color: #336600 } /* Name.Constant */
+.highlight .nd { color: #9999FF } /* Name.Decorator */
+.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
+.highlight .ne { color: #CC0000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #CC00FF } /* Name.Function */
+.highlight .nl { color: #9999FF } /* Name.Label */
+.highlight .nn { color: #00CCFF; font-weight: bold } /* Name.Namespace */
+.highlight .nt { color: #330099; font-weight: bold } /* Name.Tag */
+.highlight .nv { color: #003333 } /* Name.Variable */
+.highlight .ow { color: #000000; font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mf { color: #FF6600 } /* Literal.Number.Float */
+.highlight .mh { color: #FF6600 } /* Literal.Number.Hex */
+.highlight .mi { color: #FF6600 } /* Literal.Number.Integer */
+.highlight .mo { color: #FF6600 } /* Literal.Number.Oct */
+.highlight .sb { color: #CC3300 } /* Literal.String.Backtick */
+.highlight .sc { color: #CC3300 } /* Literal.String.Char */
+.highlight .sd { color: #CC3300; font-style: italic } /* Literal.String.Doc */
+.highlight .s2 { color: #CC3300 } /* Literal.String.Double */
+.highlight .se { color: #CC3300; font-weight: bold } /* Literal.String.Escape */
+.highlight .sh { color: #CC3300 } /* Literal.String.Heredoc */
+.highlight .si { color: #AA0000 } /* Literal.String.Interpol */
+.highlight .sx { color: #CC3300 } /* Literal.String.Other */
+.highlight .sr { color: #33AAAA } /* Literal.String.Regex */
+.highlight .s1 { color: #CC3300 } /* Literal.String.Single */
+.highlight .ss { color: #FFCC33 } /* Literal.String.Symbol */
+.highlight .bp { color: #336666 } /* Name.Builtin.Pseudo */
+.highlight .vc { color: #003333 } /* Name.Variable.Class */
+.highlight .vg { color: #003333 } /* Name.Variable.Global */
+.highlight .vi { color: #003333 } /* Name.Variable.Instance */
+.highlight .il { color: #FF6600 } /* Literal.Number.Integer.Long */
+
+.type-csharp .highlight .k { color: #0000FF }
+.type-csharp .highlight .kt { color: #0000FF }
+.type-csharp .highlight .nf { color: #000000; font-weight: normal }
+.type-csharp .highlight .nc { color: #2B91AF }
+.type-csharp .highlight .nn { color: #000000 }
+.type-csharp .highlight .s { color: #A31515 }
+.type-csharp .highlight .sc { color: #A31515 }
429 stylesheets/stylesheet.css
@@ -0,0 +1,429 @@
+/*******************************************************************************
+Slate Theme for Github Pages
+by Jason Costello, @jsncostello
+*******************************************************************************/
+
+@import url(pygment_trac.css);
+
+/*******************************************************************************
+MeyerWeb Reset
+*******************************************************************************/
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td,
+article, aside, canvas, details, embed,
+figure, figcaption, footer, header, hgroup,
+menu, nav, output, ruby, section, summary,
+time, mark, audio, video {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ font: inherit;
+ vertical-align: baseline;
+}
+
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure,
+footer, header, hgroup, menu, nav, section {
+ display: block;
+}
+
+ol, ul {
+ list-style: none;
+}
+
+blockquote, q {
+}
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+a:focus {
+ outline: none;
+}
+
+/*******************************************************************************
+Theme Styles
+*******************************************************************************/
+
+body {
+ box-sizing: border-box;
+ color:#373737;
+ background: #212121;
+ font-size: 16px;
+ font-family: 'Myriad Pro', Calibri, Helvetica, Arial, sans-serif;
+ line-height: 1.5;
+ -webkit-font-smoothing: antialiased;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ margin: 10px 0;
+ font-weight: 700;
+ color:#222222;
+ font-family: 'Lucida Grande', 'Calibri', Helvetica, Arial, sans-serif;
+ letter-spacing: -1px;
+}
+
+h1 {
+ font-size: 36px;
+ font-weight: 700;
+}
+
+h2 {
+ padding-bottom: 10px;
+ font-size: 32px;
+ background: url('../images/bg_hr.png') repeat-x bottom;
+}
+
+h3 {
+ font-size: 24px;
+}
+
+h4 {
+ font-size: 21px;
+}
+
+h5 {
+ font-size: 18px;
+}
+
+h6 {
+ font-size: 16px;
+}
+
+p {
+ margin: 10px 0 15px 0;
+}
+
+footer p {
+ color: #f2f2f2;
+}
+
+a {
+ text-decoration: none;
+ color: #007edf;
+ text-shadow: none;
+
+ transition: color 0.5s ease;
+ transition: text-shadow 0.5s ease;
+ -moz-transition: color 0.5s ease;
+ -moz-transition: text-shadow 0.5s ease;
+ -o-transition: color 0.5s ease;
+ -o-transition: text-shadow 0.5s ease;
+ -ms-transition: color 0.5s ease;
+ -ms-transition: text-shadow 0.5s ease;
+}
+
+#main_content a:hover {
+ color: #0069ba;
+ text-shadow: #0090ff 0px 0px 2px;
+}
+
+footer a:hover {
+ color: #43adff;
+ text-shadow: #0090ff 0px 0px 2px;
+}
+
+em {
+ font-style: italic;
+}
+
+strong {
+ font-weight: bold;
+}
+
+img {
+ position: relative;
+ margin: 0 auto;
+ max-width: 739px;
+ padding: 5px;
+ margin: 10px 0 10px 0;
+ border: 1px solid #ebebeb;
+
+ box-shadow: 0 0 5px #ebebeb;
+ -webkit-box-shadow: 0 0 5px #ebebeb;
+ -moz-box-shadow: 0 0 5px #ebebeb;
+ -o-box-shadow: 0 0 5px #ebebeb;
+ -ms-box-shadow: 0 0 5px #ebebeb;
+}
+
+pre, code {
+ width: 100%;
+ color: #222;
+ background-color: #fff;
+
+ font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
+ font-size: 14px;
+
+ border-radius: 2px;
+ -moz-border-radius: 2px;
+ -webkit-border-radius: 2px;
+
+
+
+}
+
+pre {
+ width: 100%;
+ padding: 10px;
+ box-shadow: 0 0 10px rgba(0,0,0,.1);
+ overflow: auto;
+}
+
+code {
+ padding: 3px;
+ margin: 0 3px;
+ box-shadow: 0 0 10px rgba(0,0,0,.1);
+}
+
+pre code {
+ display: block;
+ box-shadow: none;
+}
+
+blockquote {
+ color: #666;
+ margin-bottom: 20px;
+ padding: 0 0 0 20px;
+ border-left: 3px solid #bbb;
+}
+
+ul, ol, dl {
+ margin-bottom: 15px
+}
+
+ul li {
+ list-style: inside;
+ padding-left: 20px;
+}
+
+ol li {
+ list-style: decimal inside;
+ padding-left: 20px;
+}
+
+dl dt {
+ font-weight: bold;
+}
+
+dl dd {
+ padding-left: 20px;
+ font-style: italic;
+}
+
+dl p {
+ padding-left: 20px;
+ font-style: italic;
+}
+
+hr {
+ height: 1px;
+ margin-bottom: 5px;
+ border: none;
+ background: url('../images/bg_hr.png') repeat-x center;
+}
+
+table {
+ border: 1px solid #373737;
+ margin-bottom: 20px;
+ text-align: left;
+ }
+
+th {
+ font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
+ padding: 10px;
+ background: #373737;
+ color: #fff;
+ }
+
+td {
+ padding: 10px;
+ border: 1px solid #373737;
+ }
+
+form {
+ background: #f2f2f2;
+ padding: 20px;
+}
+
+img {
+ width: 100%;
+ max-width: 100%;
+}
+
+/*******************************************************************************
+Full-Width Styles
+*******************************************************************************/
+
+.outer {
+ width: 100%;
+}
+
+.inner {
+ position: relative;
+ max-width: 640px;
+ padding: 20px 10px;
+ margin: 0 auto;
+}
+
+#forkme_banner {
+ display: block;
+ position: absolute;
+ top:0;
+ right: 10px;
+ z-index: 10;
+ padding: 10px 50px 10px 10px;
+ color: #fff;
+ background: url('../images/blacktocat.png') #0090ff no-repeat 95% 50%;
+ font-weight: 700;
+ box-shadow: 0 0 10px rgba(0,0,0,.5);
+ border-bottom-left-radius: 2px;
+ border-bottom-right-radius: 2px;
+}
+
+#header_wrap {
+ background: #212121;
+ background: -moz-linear-gradient(top, #373737, #212121);
+ background: -webkit-linear-gradient(top, #373737, #212121);
+ background: -ms-linear-gradient(top, #373737, #212121);
+ background: -o-linear-gradient(top, #373737, #212121);
+ background: linear-gradient(top, #373737, #212121);
+}
+
+#header_wrap .inner {
+ padding: 50px 10px 30px 10px;
+}
+
+#project_title {
+ margin: 0;
+ color: #fff;
+ font-size: 42px;
+ font-weight: 700;
+ text-shadow: #111 0px 0px 10px;
+}
+
+#project_tagline {
+ color: #fff;
+ font-size: 24px;
+ font-weight: 300;
+ background: none;
+ text-shadow: #111 0px 0px 10px;
+}
+
+#downloads {
+ position: absolute;
+ width: 210px;
+ z-index: 10;
+ bottom: -40px;
+ right: 0;
+ height: 70px;
+ background: url('../images/icon_download.png') no-repeat 0% 90%;
+}
+
+.zip_download_link {
+ display: block;
+ float: right;
+ width: 90px;
+ height:70px;
+ text-indent: -5000px;
+ overflow: hidden;
+ background: url(../images/sprite_download.png) no-repeat bottom left;
+}
+
+.tar_download_link {
+ display: block;
+ float: right;
+ width: 90px;
+ height:70px;
+ text-indent: -5000px;
+ overflow: hidden;
+ background: url(../images/sprite_download.png) no-repeat bottom right;
+ margin-left: 10px;
+}
+
+.zip_download_link:hover {
+ background: url(../images/sprite_download.png) no-repeat top left;
+}
+
+.tar_download_link:hover {
+ background: url(../images/sprite_download.png) no-repeat top right;
+}
+
+#main_content_wrap {
+ background: #f2f2f2;
+ border-top: 1px solid #111;
+ border-bottom: 1px solid #111;
+}
+
+#main_content {
+ padding-top: 40px;
+}
+
+#footer_wrap {
+ background: #212121;
+}
+
+
+
+/*******************************************************************************
+Small Device Styles
+*******************************************************************************/
+
+@media screen and (max-width: 480px) {
+ body {
+ font-size:14px;
+ }
+
+ #downloads {
+ display: none;
+ }
+
+ .inner {
+ min-width: 320px;
+ max-width: 480px;
+ }
+
+ #project_title {
+ font-size: 32px;
+ }
+
+ h1 {
+ font-size: 28px;
+ }
+
+ h2 {
+ font-size: 24px;
+ }
+
+ h3 {
+ font-size: 21px;
+ }
+
+ h4 {
+ font-size: 18px;
+ }
+
+ h5 {
+ font-size: 14px;
+ }
+
+ h6 {
+ font-size: 12px;
+ }
+
+ code, pre {
+ min-width: 320px;
+ max-width: 480px;
+ font-size: 11px;
+ }
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.