Skip to content

Instantly share code, notes, and snippets.

View dbussink's full-sized avatar

Dirkjan Bussink dbussink

View GitHub Profile
diff --git a/do_sqlite3/ext/do_sqlite3_ext/do_sqlite3_ext.c b/do_sqlite3/ext/do_sqlite3_ext/do_sqlite3_ext.c
index 395deb8..b8a1a0c 100755
--- a/do_sqlite3/ext/do_sqlite3_ext/do_sqlite3_ext.c
+++ b/do_sqlite3/ext/do_sqlite3_ext/do_sqlite3_ext.c
@@ -330,21 +330,31 @@ static int flags_from_uri(VALUE uri) {
int flags = 0;
if (!NIL_P(query_values)) {
/// scan for flags
+#ifdef SQLITE_OPEN_READONLY
if (FLAG_PRESENT(query_values, OPEN_FLAG_READONLY)) {
diff --git a/do_postgres/ext/do_postgres_ext/extconf.rb b/do_postgres/ext/do_postgres_ext/extconf.rb
index a8e7631..116de1c 100644
--- a/do_postgres/ext/do_postgres_ext/extconf.rb
+++ b/do_postgres/ext/do_postgres_ext/extconf.rb
@@ -22,6 +22,7 @@ def pg_config(type)
end
def have_build_env
+ have_header('win32.h') if RUBY_PLATFORM =~ /mswin/
(have_library('pq') || have_library('libpq')) &&
lib/spec/
|-- public
| |-- command_spec.rb
| |-- connection_spec.rb
| |-- quoting_spec.rb
| |-- reader_spec.rb
| |-- result_spec.rb
| `-- typecast
| |-- bigdecimal_spec.rb
| |-- binary_spec.rb
diff --git a/do_mysql/ext/do_mysql_ext/do_mysql_ext.c b/do_mysql/ext/do_mysql_ext/do_mysql_ext.c
index 8f12e6e..9828265 100755
--- a/do_mysql/ext/do_mysql_ext/do_mysql_ext.c
+++ b/do_mysql/ext/do_mysql_ext/do_mysql_ext.c
@@ -391,8 +391,7 @@ static MYSQL_RES* cCommand_execute_async(VALUE self, MYSQL* db, VALUE query) {
VALUE connection = rb_iv_get(self, "@connection");
- retval = mysql_ping(db);
- if(retval == CR_SERVER_GONE_ERROR) {
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 142
Server version: 5.0.67 MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> SELECT COUNT(*) FROM `users` WHERE (`id` = 1);
(in /Users/dirkjan/Documents/projects/do/do_sqlite3)
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake/gempackagetask.rb:13:Warning: Gem::manage_gems is deprecated and will be removed on or after March 2009.
** Invoke cross (first_time)
** Invoke build:win32:sqlite3 (first_time)
** Invoke /Users/dirkjan/Documents/projects/do/cross/sqlite-3_6_6_2/include/sqlite3.h (first_time, not_needed)
** Invoke /Users/dirkjan/Documents/projects/do/cross/sqlite-3_6_6_2/include (first_time, not_needed)
** Invoke /Users/dirkjan/Documents/projects/do/stash/sqlite-amalgamation-3_6_6_2.zip (first_time, not_needed)
** Invoke /Users/dirkjan/Documents/projects/do/stash (first_time, not_needed)
** Invoke /Users/dirkjan/Documents/projects/do/cross/sqlite-3_6_6_2/lib/libsqlite3.a (first_time, not_needed)
** Invoke /Users/dirkjan/Documents/projects/do/cross/sqlite-3_6_6_2/lib (first_time, not_needed)
(in /Users/dirkjan/Documents/projects/do/do_sqlite3)
/Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake/gempackagetask.rb:13:Warning: Gem::manage_gems is deprecated and will be removed on or after March 2009.
** Invoke cross (first_time)
** Invoke build:win32:sqlite3 (first_time)
** Invoke /Users/dirkjan/Documents/projects/do/cross/sqlite-3_6_6_2/include/sqlite3.h (first_time, not_needed)
** Invoke /Users/dirkjan/Documents/projects/do/cross/sqlite-3_6_6_2/include (first_time, not_needed)
** Invoke /Users/dirkjan/Documents/projects/do/stash/sqlite-amalgamation-3_6_6_2.zip (first_time, not_needed)
** Invoke /Users/dirkjan/Documents/projects/do/stash (first_time, not_needed)
** Invoke /Users/dirkjan/Documents/projects/do/cross/sqlite-3_6_6_2/lib/libsqlite3.a (first_time, not_needed)
** Invoke /Users/dirkjan/Documents/projects/do/cross/sqlite-3_6_6_2/lib (first_time, not_needed)
begin
DataMapper::Transaction.new(repository.adapter) do
end
redirect target_url
rescue DataMapper::ValidationError => e
@show_new_form = true
render :new
end
static struct errcodes {
int error_no;
const char *error_name;
const char *exception;
} errors [] = {
#ifdef ERRCODE_CONNECTION_EXCEPTION
{ ERRCODE_CONNECTION_EXCEPTION,
"ERRCODE_CONNECTION_EXCEPTION", "ConnectionError"},
#endif
#ifdef ERRCODE_CONNECTION_DOES_NOT_EXIST
module DataObjects
class SQLError < Error
attr_reader :message
attr_reader :code
attr_reader :sqlstate
attr_reader :query
attr_reader :uri
def initialize(message, code = nil, sqlstate = nil, query = nil, uri = nil)