amalgalite 0.15.0-x86-mswin32 → 1.0.0-x86-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/{HISTORY → HISTORY.rdoc} +15 -1
- data/{README → README.rdoc} +2 -1
- data/examples/filestore.db +0 -0
- data/examples/gems.db +0 -0
- data/ext/amalgalite/amalgalite3.c +1 -1
- data/ext/amalgalite/amalgalite3_blob.c +1 -1
- data/ext/amalgalite/amalgalite3_constants.c +157 -0
- data/ext/amalgalite/amalgalite3_database.c +7 -7
- data/ext/amalgalite/amalgalite3_requires_bootstrap.c +11 -12
- data/ext/amalgalite/amalgalite3_statement.c +3 -3
- data/ext/amalgalite/extconf.rb +17 -20
- data/ext/amalgalite/gen_constants.rb +84 -25
- data/ext/amalgalite/sqlite3.c +3379 -1146
- data/ext/amalgalite/sqlite3.h +87 -12
- data/ext/amalgalite/sqlite3ext.h +42 -0
- data/gemspec.rb +9 -9
- data/lib/amalgalite/1.8/amalgalite3.so +0 -0
- data/lib/amalgalite/1.9/amalgalite3.so +0 -0
- data/lib/amalgalite/csv_table_importer.rb +7 -2
- data/lib/amalgalite/database.rb +1 -1
- data/lib/amalgalite/paths.rb +10 -0
- data/lib/amalgalite/sqlite3/constants.rb +20 -5
- data/lib/amalgalite/version.rb +2 -2
- data/spec/database_spec.rb +0 -2
- data/spec/default_map_spec.rb +0 -3
- data/spec/requires_spec.rb +0 -3
- data/spec/rtree_spec.rb +1 -3
- data/spec/schema_spec.rb +1 -4
- data/spec/spec_helper.rb +7 -5
- data/spec/sqlite3/constants_spec.rb +52 -9
- data/spec/sqlite3/database_status_spec.rb +1 -1
- data/spec/sqlite3/version_spec.rb +5 -5
- data/spec/storage_map_spec.rb +1 -4
- data/spec/tap_spec.rb +1 -3
- data/spec/text_map_spec.rb +1 -4
- data/spec/type_map_spec.rb +1 -4
- data/tasks/announce.rake +9 -9
- data/tasks/config.rb +18 -18
- data/tasks/extension.rake +37 -20
- data/tasks/rspec.rake +7 -10
- metadata +40 -42
- data/tasks/rubyforge.rake +0 -59
data/ext/amalgalite/sqlite3.h
CHANGED
@@ -107,9 +107,9 @@ extern "C" {
|
|
107
107
|
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
108
108
|
** [sqlite_version()] and [sqlite_source_id()].
|
109
109
|
*/
|
110
|
-
#define SQLITE_VERSION "3.7.
|
111
|
-
#define SQLITE_VERSION_NUMBER
|
112
|
-
#define SQLITE_SOURCE_ID "2010-
|
110
|
+
#define SQLITE_VERSION "3.7.4"
|
111
|
+
#define SQLITE_VERSION_NUMBER 3007004
|
112
|
+
#define SQLITE_SOURCE_ID "2010-12-07 20:14:09 a586a4deeb25330037a49df295b36aaf624d0f45"
|
113
113
|
|
114
114
|
/*
|
115
115
|
** CAPI3REF: Run-Time Library Version Numbers
|
@@ -542,6 +542,18 @@ SQLITE_API int sqlite3_exec(
|
|
542
542
|
** equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics.
|
543
543
|
** If the lower four bits equal SQLITE_SYNC_FULL, that means
|
544
544
|
** to use Mac OS X style fullsync instead of fsync().
|
545
|
+
**
|
546
|
+
** Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags
|
547
|
+
** with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL
|
548
|
+
** settings. The [synchronous pragma] determines when calls to the
|
549
|
+
** xSync VFS method occur and applies uniformly across all platforms.
|
550
|
+
** The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how
|
551
|
+
** energetic or rigorous or forceful the sync operations are and
|
552
|
+
** only make a difference on Mac OSX for the default SQLite code.
|
553
|
+
** (Third-party VFS implementations might also make the distinction
|
554
|
+
** between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the
|
555
|
+
** operating systems natively supported by SQLite, only Mac OSX
|
556
|
+
** cares about the difference.)
|
545
557
|
*/
|
546
558
|
#define SQLITE_SYNC_NORMAL 0x00002
|
547
559
|
#define SQLITE_SYNC_FULL 0x00003
|
@@ -710,6 +722,8 @@ struct sqlite3_io_methods {
|
|
710
722
|
#define SQLITE_LAST_ERRNO 4
|
711
723
|
#define SQLITE_FCNTL_SIZE_HINT 5
|
712
724
|
#define SQLITE_FCNTL_CHUNK_SIZE 6
|
725
|
+
#define SQLITE_FCNTL_FILE_POINTER 7
|
726
|
+
|
713
727
|
|
714
728
|
/*
|
715
729
|
** CAPI3REF: Mutex Handle
|
@@ -2633,6 +2647,20 @@ SQLITE_API int sqlite3_prepare16_v2(
|
|
2633
2647
|
*/
|
2634
2648
|
SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);
|
2635
2649
|
|
2650
|
+
/*
|
2651
|
+
** CAPI3REF: Determine If An SQL Statement Writes The Database
|
2652
|
+
**
|
2653
|
+
** ^The sqlite3_stmt_readonly(X) interface returns true (non-zero) if
|
2654
|
+
** the [prepared statement] X is [SELECT] statement and false (zero) if
|
2655
|
+
** X is an [INSERT], [UPDATE], [DELETE], CREATE, DROP, [ANALYZE],
|
2656
|
+
** [ALTER], or [REINDEX] statement.
|
2657
|
+
** If X is a NULL pointer or any other kind of statement, including but
|
2658
|
+
** not limited to [ATTACH], [DETACH], [COMMIT], [ROLLBACK], [RELEASE],
|
2659
|
+
** [SAVEPOINT], [PRAGMA], or [VACUUM] the result of sqlite3_stmt_readonly(X) is
|
2660
|
+
** undefined.
|
2661
|
+
*/
|
2662
|
+
SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
|
2663
|
+
|
2636
2664
|
/*
|
2637
2665
|
** CAPI3REF: Dynamically Typed Value Object
|
2638
2666
|
** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value}
|
@@ -2732,7 +2760,10 @@ typedef struct sqlite3_context sqlite3_context;
|
|
2732
2760
|
**
|
2733
2761
|
** ^The fifth argument to sqlite3_bind_blob(), sqlite3_bind_text(), and
|
2734
2762
|
** sqlite3_bind_text16() is a destructor used to dispose of the BLOB or
|
2735
|
-
** string after SQLite has finished with it.
|
2763
|
+
** string after SQLite has finished with it. ^The destructor is called
|
2764
|
+
** to dispose of the BLOB or string even if the call to sqlite3_bind_blob(),
|
2765
|
+
** sqlite3_bind_text(), or sqlite3_bind_text16() fails.
|
2766
|
+
** ^If the fifth argument is
|
2736
2767
|
** the special value [SQLITE_STATIC], then SQLite assumes that the
|
2737
2768
|
** information is in static, unmanaged space and does not need to be freed.
|
2738
2769
|
** ^If the fifth argument has the value [SQLITE_TRANSIENT], then
|
@@ -3372,12 +3403,15 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt);
|
|
3372
3403
|
** SQL function or aggregate, pass NULL poiners for all three function
|
3373
3404
|
** callbacks.
|
3374
3405
|
**
|
3375
|
-
** ^If the tenth parameter to sqlite3_create_function_v2() is not NULL,
|
3376
|
-
** then it is
|
3377
|
-
**
|
3378
|
-
**
|
3379
|
-
**
|
3380
|
-
**
|
3406
|
+
** ^(If the tenth parameter to sqlite3_create_function_v2() is not NULL,
|
3407
|
+
** then it is destructor for the application data pointer.
|
3408
|
+
** The destructor is invoked when the function is deleted, either by being
|
3409
|
+
** overloaded or when the database connection closes.)^
|
3410
|
+
** ^The destructor is also invoked if the call to
|
3411
|
+
** sqlite3_create_function_v2() fails.
|
3412
|
+
** ^When the destructor callback of the tenth parameter is invoked, it
|
3413
|
+
** is passed a single argument which is a copy of the application data
|
3414
|
+
** pointer which was the fifth parameter to sqlite3_create_function_v2().
|
3381
3415
|
**
|
3382
3416
|
** ^It is permitted to register multiple implementations of the same
|
3383
3417
|
** functions with the same name but with either differing numbers of
|
@@ -3841,6 +3875,15 @@ SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n);
|
|
3841
3875
|
** calls to the collation creation functions or when the
|
3842
3876
|
** [database connection] is closed using [sqlite3_close()].
|
3843
3877
|
**
|
3878
|
+
** ^The xDestroy callback is <u>not</u> called if the
|
3879
|
+
** sqlite3_create_collation_v2() function fails. Applications that invoke
|
3880
|
+
** sqlite3_create_collation_v2() with a non-NULL xDestroy argument should
|
3881
|
+
** check the return code and dispose of the application data pointer
|
3882
|
+
** themselves rather than expecting SQLite to deal with it for them.
|
3883
|
+
** This is different from every other SQLite interface. The inconsistency
|
3884
|
+
** is unfortunate but cannot be changed without breaking backwards
|
3885
|
+
** compatibility.
|
3886
|
+
**
|
3844
3887
|
** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()].
|
3845
3888
|
*/
|
3846
3889
|
SQLITE_API int sqlite3_create_collation(
|
@@ -4595,7 +4638,9 @@ struct sqlite3_index_info {
|
|
4595
4638
|
** ^The sqlite3_create_module_v2() interface has a fifth parameter which
|
4596
4639
|
** is a pointer to a destructor for the pClientData. ^SQLite will
|
4597
4640
|
** invoke the destructor function (if it is not NULL) when SQLite
|
4598
|
-
** no longer needs the pClientData pointer. ^The
|
4641
|
+
** no longer needs the pClientData pointer. ^The destructor will also
|
4642
|
+
** be invoked if the call to sqlite3_create_module_v2() fails.
|
4643
|
+
** ^The sqlite3_create_module()
|
4599
4644
|
** interface is equivalent to sqlite3_create_module_v2() with a NULL
|
4600
4645
|
** destructor.
|
4601
4646
|
*/
|
@@ -4778,6 +4823,30 @@ SQLITE_API int sqlite3_blob_open(
|
|
4778
4823
|
sqlite3_blob **ppBlob
|
4779
4824
|
);
|
4780
4825
|
|
4826
|
+
/*
|
4827
|
+
** CAPI3REF: Move a BLOB Handle to a New Row
|
4828
|
+
**
|
4829
|
+
** ^This function is used to move an existing blob handle so that it points
|
4830
|
+
** to a different row of the same database table. ^The new row is identified
|
4831
|
+
** by the rowid value passed as the second argument. Only the row can be
|
4832
|
+
** changed. ^The database, table and column on which the blob handle is open
|
4833
|
+
** remain the same. Moving an existing blob handle to a new row can be
|
4834
|
+
** faster than closing the existing handle and opening a new one.
|
4835
|
+
**
|
4836
|
+
** ^(The new row must meet the same criteria as for [sqlite3_blob_open()] -
|
4837
|
+
** it must exist and there must be either a blob or text value stored in
|
4838
|
+
** the nominated column.)^ ^If the new row is not present in the table, or if
|
4839
|
+
** it does not contain a blob or text value, or if another error occurs, an
|
4840
|
+
** SQLite error code is returned and the blob handle is considered aborted.
|
4841
|
+
** ^All subsequent calls to [sqlite3_blob_read()], [sqlite3_blob_write()] or
|
4842
|
+
** [sqlite3_blob_reopen()] on an aborted blob handle immediately return
|
4843
|
+
** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle
|
4844
|
+
** always returns zero.
|
4845
|
+
**
|
4846
|
+
** ^This function sets the database handle error code and message.
|
4847
|
+
*/
|
4848
|
+
SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64);
|
4849
|
+
|
4781
4850
|
/*
|
4782
4851
|
** CAPI3REF: Close A BLOB Handle
|
4783
4852
|
**
|
@@ -5185,7 +5254,7 @@ SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
|
|
5185
5254
|
** ^The [sqlite3_file_control()] interface makes a direct call to the
|
5186
5255
|
** xFileControl method for the [sqlite3_io_methods] object associated
|
5187
5256
|
** with a particular database identified by the second argument. ^The
|
5188
|
-
** name of the database "main" for the main database or "temp" for the
|
5257
|
+
** name of the database is "main" for the main database or "temp" for the
|
5189
5258
|
** TEMP database, or the name that appears after the AS keyword for
|
5190
5259
|
** databases that are added using the [ATTACH] SQL command.
|
5191
5260
|
** ^A NULL pointer can be used in place of "main" to refer to the
|
@@ -5195,6 +5264,12 @@ SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*);
|
|
5195
5264
|
** the xFileControl method. ^The return value of the xFileControl
|
5196
5265
|
** method becomes the return value of this routine.
|
5197
5266
|
**
|
5267
|
+
** ^The SQLITE_FCNTL_FILE_POINTER value for the op parameter causes
|
5268
|
+
** a pointer to the underlying [sqlite3_file] object to be written into
|
5269
|
+
** the space pointed to by the 4th parameter. ^The SQLITE_FCNTL_FILE_POINTER
|
5270
|
+
** case is a short-circuit path which does not actually invoke the
|
5271
|
+
** underlying sqlite3_io_methods.xFileControl method.
|
5272
|
+
**
|
5198
5273
|
** ^If the second parameter (zDbName) does not match the name of any
|
5199
5274
|
** open database file, then SQLITE_ERROR is returned. ^This error
|
5200
5275
|
** code is not remembered and will not be recalled by [sqlite3_errcode()]
|
data/ext/amalgalite/sqlite3ext.h
CHANGED
@@ -191,6 +191,27 @@ struct sqlite3_api_routines {
|
|
191
191
|
sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);
|
192
192
|
const char *(*sql)(sqlite3_stmt*);
|
193
193
|
int (*status)(int,int*,int*,int);
|
194
|
+
int (*backup_finish)(sqlite3_backup*);
|
195
|
+
sqlite3_backup *(*backup_init)(sqlite3*,const char*,sqlite3*,const char*);
|
196
|
+
int (*backup_pagecount)(sqlite3_backup*);
|
197
|
+
int (*backup_remaining)(sqlite3_backup*);
|
198
|
+
int (*backup_step)(sqlite3_backup*,int);
|
199
|
+
const char *(*compileoption_get)(int);
|
200
|
+
int (*compileoption_used)(const char*);
|
201
|
+
int (*create_function_v2)(sqlite3*,const char*,int,int,void*,void (*xFunc)(sqlite3_context*,int,sqlite3_value**),void (*xStep)(sqlite3_context*,int,sqlite3_value**),void (*xFinal)(sqlite3_context*),void(*xDestroy)(void*));
|
202
|
+
int (*db_config)(sqlite3*,int,...);
|
203
|
+
sqlite3_mutex *(*db_mutex)(sqlite3*);
|
204
|
+
int (*db_status)(sqlite3*,int,int*,int*,int);
|
205
|
+
int (*extended_errcode)(sqlite3*);
|
206
|
+
void (*log)(int,const char*,...);
|
207
|
+
sqlite3_int64 (*soft_heap_limit64)(sqlite3_int64);
|
208
|
+
const char *(*sourceid)(void);
|
209
|
+
int (*stmt_status)(sqlite3_stmt*,int,int);
|
210
|
+
int (*strnicmp)(const char*,const char*,int);
|
211
|
+
int (*unlock_notify)(sqlite3*,void(*)(void**,int),void*);
|
212
|
+
int (*wal_autocheckpoint)(sqlite3*,int);
|
213
|
+
int (*wal_checkpoint)(sqlite3*,const char*);
|
214
|
+
void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*);
|
194
215
|
};
|
195
216
|
|
196
217
|
/*
|
@@ -370,6 +391,27 @@ struct sqlite3_api_routines {
|
|
370
391
|
#define sqlite3_next_stmt sqlite3_api->next_stmt
|
371
392
|
#define sqlite3_sql sqlite3_api->sql
|
372
393
|
#define sqlite3_status sqlite3_api->status
|
394
|
+
#define sqlite3_backup_finish sqlite3_api->backup_finish
|
395
|
+
#define sqlite3_backup_init sqlite3_api->backup_init
|
396
|
+
#define sqlite3_backup_pagecount sqlite3_api->backup_pagecount
|
397
|
+
#define sqlite3_backup_remaining sqlite3_api->backup_remaining
|
398
|
+
#define sqlite3_backup_step sqlite3_api->backup_step
|
399
|
+
#define sqlite3_compileoption_get sqlite3_api->compileoption_get
|
400
|
+
#define sqlite3_compileoption_used sqlite3_api->compileoption_used
|
401
|
+
#define sqlite3_create_function_v2 sqlite3_api->create_function_v2
|
402
|
+
#define sqlite3_db_config sqlite3_api->db_config
|
403
|
+
#define sqlite3_db_mutex sqlite3_api->db_mutex
|
404
|
+
#define sqlite3_db_status sqlite3_api->db_status
|
405
|
+
#define sqlite3_extended_errcode sqlite3_api->extended_errcode
|
406
|
+
#define sqlite3_log sqlite3_api->log
|
407
|
+
#define sqlite3_soft_heap_limit64 sqlite3_api->soft_heap_limit64
|
408
|
+
#define sqlite3_sourceid sqlite3_api->sourceid
|
409
|
+
#define sqlite3_stmt_status sqlite3_api->stmt_status
|
410
|
+
#define sqlite3_strnicmp sqlite3_api->strnicmp
|
411
|
+
#define sqlite3_unlock_notify sqlite3_api->unlock_notify
|
412
|
+
#define sqlite3_wal_autocheckpoint sqlite3_api->wal_autocheckpoint
|
413
|
+
#define sqlite3_wal_checkpoint sqlite3_api->wal_checkpoint
|
414
|
+
#define sqlite3_wal_hook sqlite3_api->wal_hook
|
373
415
|
#endif /* SQLITE_CORE */
|
374
416
|
|
375
417
|
#define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api = 0;
|
data/gemspec.rb
CHANGED
@@ -5,7 +5,7 @@ require 'tasks/config'
|
|
5
5
|
Amalgalite::GEM_SPEC = Gem::Specification.new do |spec|
|
6
6
|
proj = Configuration.for('project')
|
7
7
|
spec.name = proj.name
|
8
|
-
spec.version = Amalgalite::
|
8
|
+
spec.version = Amalgalite::Version.to_s
|
9
9
|
|
10
10
|
spec.author = proj.author
|
11
11
|
spec.email = proj.email
|
@@ -20,15 +20,15 @@ Amalgalite::GEM_SPEC = Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = pkg.files.bin.collect { |b| File.basename(b) }
|
21
21
|
|
22
22
|
# add dependencies here
|
23
|
-
spec.add_dependency("arrayfields", "~> 4.7.
|
24
|
-
spec.add_dependency("fastercsv", "~> 1.5.
|
23
|
+
spec.add_dependency("arrayfields", "~> 4.7.4")
|
24
|
+
spec.add_dependency("fastercsv", "~> 1.5.4")
|
25
25
|
|
26
|
-
spec.add_development_dependency("rake", "~> 0.8.
|
27
|
-
spec.add_development_dependency("configuration", "~>
|
28
|
-
spec.add_development_dependency("rspec", "~>
|
29
|
-
spec.add_development_dependency("rake-compiler", "~> 0.5
|
30
|
-
spec.add_development_dependency('
|
31
|
-
spec.add_development_dependency('rcov', "~> 0.
|
26
|
+
spec.add_development_dependency("rake", "~> 0.8.7")
|
27
|
+
spec.add_development_dependency("configuration", "~> 1.2.0")
|
28
|
+
spec.add_development_dependency("rspec", "~> 2.4.0")
|
29
|
+
spec.add_development_dependency("rake-compiler", "~> 0.7.5")
|
30
|
+
spec.add_development_dependency('zip', "~> 2.0.2")
|
31
|
+
spec.add_development_dependency('rcov', "~> 0.9.9")
|
32
32
|
|
33
33
|
if ext_conf = Configuration.for_if_exist?("extension") then
|
34
34
|
spec.extensions << ext_conf.configs
|
Binary file
|
Binary file
|
@@ -1,4 +1,9 @@
|
|
1
|
-
|
1
|
+
if RUBY_VERSION >= "1.9"
|
2
|
+
require 'csv'
|
3
|
+
else
|
4
|
+
require 'fastercsv'
|
5
|
+
::CSV = ::FasterCSV
|
6
|
+
end
|
2
7
|
module Amalgalite
|
3
8
|
##
|
4
9
|
# A class to deal with importing CSV data into a single table in the
|
@@ -17,7 +22,7 @@ module Amalgalite
|
|
17
22
|
def run
|
18
23
|
@database.transaction do |db|
|
19
24
|
db.prepare( insert_sql ) do |stmt|
|
20
|
-
::
|
25
|
+
::CSV.foreach( @csv_path, @options ) do |row|
|
21
26
|
stmt.execute( row )
|
22
27
|
end
|
23
28
|
end
|
data/lib/amalgalite/database.rb
CHANGED
@@ -956,7 +956,7 @@ module Amalgalite
|
|
956
956
|
#
|
957
957
|
# import_csv_to_table() takes 2 required arguments, and a hash of options. The
|
958
958
|
# first argument is the path to a CSV, the second is the table in which
|
959
|
-
# to load the data. The options has is a subset of those used by
|
959
|
+
# to load the data. The options has is a subset of those used by CSV
|
960
960
|
#
|
961
961
|
# * :col_sep - the string placed between each field. Default is ","
|
962
962
|
# * :row_sep - the String appended to the end of each row. Default is :auto
|
data/lib/amalgalite/paths.rb
CHANGED
@@ -61,6 +61,16 @@ module Amalgalite
|
|
61
61
|
self.sub_path("ext", *args)
|
62
62
|
end
|
63
63
|
|
64
|
+
# returns:: [String] The full expanded path of the +spec+ directory below
|
65
|
+
# _root_dir_. All parameters passed in are joined onto the
|
66
|
+
# result. Trailing File::SEPARATOR is guaranteed if
|
67
|
+
# _*args_ are *not* present.
|
68
|
+
#
|
69
|
+
def self.spec_path(*args)
|
70
|
+
self.sub_path("spec", *args)
|
71
|
+
end
|
72
|
+
|
73
|
+
|
64
74
|
def self.sub_path(sub,*args)
|
65
75
|
sp = ::File.join(root_dir, sub) + File::SEPARATOR
|
66
76
|
sp = ::File.join(sp, *args) if args
|
@@ -14,7 +14,7 @@ module Amalgalite::SQLite3
|
|
14
14
|
@const_map_from_value = {}
|
15
15
|
constants.each do |const_name|
|
16
16
|
c_int = const_get( const_name )
|
17
|
-
@const_map_from_value[c_int] = const_name
|
17
|
+
@const_map_from_value[c_int] = const_name.to_s
|
18
18
|
end
|
19
19
|
end
|
20
20
|
return @const_map_from_value[ value ]
|
@@ -29,7 +29,7 @@ module Amalgalite::SQLite3
|
|
29
29
|
@const_map_from_name = {}
|
30
30
|
constants.each do |const_name|
|
31
31
|
c_int = const_get( const_name )
|
32
|
-
@const_map_from_name[ const_name ] = c_int
|
32
|
+
@const_map_from_name[ const_name.to_s ] = c_int
|
33
33
|
end
|
34
34
|
end
|
35
35
|
return @const_map_from_name[ name.upcase ]
|
@@ -41,16 +41,16 @@ module Amalgalite::SQLite3
|
|
41
41
|
# DataType defines the namespace for all possible SQLite data types.
|
42
42
|
#
|
43
43
|
module DataType
|
44
|
+
extend Helpers
|
44
45
|
end
|
45
|
-
DataType.freeze
|
46
46
|
|
47
47
|
##
|
48
48
|
# Open defines the namespace for all possible flags to the Database.open
|
49
49
|
# method
|
50
50
|
#
|
51
51
|
module Open
|
52
|
+
extend Helpers
|
52
53
|
end
|
53
|
-
Open.freeze
|
54
54
|
|
55
55
|
##
|
56
56
|
# Status defines the namespace for all the possible status flags for
|
@@ -60,7 +60,6 @@ module Amalgalite::SQLite3
|
|
60
60
|
extend Helpers
|
61
61
|
end
|
62
62
|
|
63
|
-
|
64
63
|
##
|
65
64
|
# DBStatus defines the namespace for all the possible status codes for the
|
66
65
|
# Amalgalite::SQlite3::Database::Status objects.
|
@@ -76,5 +75,21 @@ module Amalgalite::SQLite3
|
|
76
75
|
module ResultCode
|
77
76
|
extend Helpers
|
78
77
|
end # end ResultCode
|
78
|
+
|
79
|
+
##
|
80
|
+
# Config defines the namespace for all possible parameter for the
|
81
|
+
# sqlite config API.
|
82
|
+
#
|
83
|
+
module Config
|
84
|
+
extend Helpers
|
85
|
+
end
|
86
|
+
|
87
|
+
##
|
88
|
+
# StatementStatus defines the namespace for all the possible status codes
|
89
|
+
# for the SQLite prepared statements
|
90
|
+
#
|
91
|
+
module StatementStatus
|
92
|
+
extend Helpers
|
93
|
+
end
|
79
94
|
end
|
80
95
|
end
|
data/lib/amalgalite/version.rb
CHANGED
data/spec/database_spec.rb
CHANGED
data/spec/default_map_spec.rb
CHANGED
data/spec/requires_spec.rb
CHANGED
data/spec/rtree_spec.rb
CHANGED
data/spec/schema_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require '
|
2
|
+
require 'rspec'
|
3
3
|
|
4
|
-
|
4
|
+
$:.unshift File.expand_path(File.join(File.dirname(__FILE__),"..","lib"))
|
5
|
+
require 'amalgalite/paths'
|
6
|
+
$:.unshift Amalgalite::Paths.root_dir
|
5
7
|
|
6
8
|
require 'amalgalite'
|
7
|
-
require
|
9
|
+
require Amalgalite::Paths.spec_path( "iso_3166_database.rb" )
|
8
10
|
|
9
11
|
class SpecInfo
|
10
12
|
class << self
|
11
13
|
def test_db
|
12
|
-
@test_db ||=
|
14
|
+
@test_db ||= Amalgalite::Paths.spec_path("data", "test.db")
|
13
15
|
end
|
14
16
|
|
15
17
|
def make_master_iso_db
|
@@ -22,7 +24,7 @@ class SpecInfo
|
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
25
|
-
|
27
|
+
RSpec.configure do |config|
|
26
28
|
config.before(:all) do
|
27
29
|
SpecInfo.make_master_iso_db
|
28
30
|
end
|