copiousfreetime / amalgalite Goto Github PK
View Code? Open in Web Editor NEWSQLite database engine embedded in a ruby extension.
License: Other
SQLite database engine embedded in a ruby extension.
License: Other
Just an idea at this point. What if the importing of a csv also created the table in which to store the csv data?
Amalgalite already has support for custom functions and aggregates - would it be possible to add support for triggers written in Ruby? Thanks -
One of the instructions in README.md reads:
5. bundle 6 rake cross native gem
A bug in the Markdown syntax caused this. What you probably meant to say was
5. bundle
6. rake cross native gem
$LOADED_FEATURES.grep( /sqlite3/ )
irb(main):001:0> $LOADED_FEATURES.grep( /sqlite3/ )
=> ["/opt/local/lib/ruby/gems/1.8/gems/composite_primary_keys-2.2.2/lib/composite_primary_keys/connection_adapters/sqlite3_adapter.rb"]
In order to help folks that need to update the http://www.sqlite.org/limits.html SQLITE_LIMIT_EXPR_DEPTh add this function in.
@jfrank3220 requested
I am not sure why this is happening....
gem uninstall fastercsv
amalgalite-1.1.2 depends on fastercsv (~> 1.5.4)
I thought amalgalite requires fastercsv only if ruby is < 1.9, but when I do gem install amalgalite, fastercsv is also installed due to dependency.
You don't ship the spec/.txt files, so you can't run the specs from a gem install. The spec/.txt files should either be added to the gem or the spec directory removed from the gem.
./spec/blob_spec.rb:30:in `read': No such file or directory - /usr/obj/ports/ruby-amalgalite-0.12.0/amalgalite-0.12.0/spec/iso-3166-country.txt (Errno::ENOENT)
Bump arrayfields dependency to 4.9.0 please
"gem install amalgalite" fails for me.
I'm on a CentOS 4.5 box running ruby 1.8.5
Could it be the ruby version that's the problem?
cheers! Lachie
I can't install the amalgalite gem. Fails with "ERROR: Failed to build gem native extension... Use RbConfig instead of obsolete and deprecated Config."
$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]
$ rvm -v
rvm 1.15.8
$ gem list
*** LOCAL GEMS ***
arrayfields (4.7.4)
bundler (1.2.0)
fastercsv (1.5.5)
git_remote_branch (0.3.3)
rainbow (1.1.4)
rake (0.9.2.2)
rubygems-bundler (1.0.7)
rvm (1.11.3.5)
$ gem install amalgalite -v '1.1.2'
Building native extensions. This could take a while...
ERROR: Error installing amalgalite:
ERROR: Failed to build gem native extension.
/Users/danielkehoe/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
extconf.rb:25: Use RbConfig instead of obsolete and deprecated Config.
creating Makefile
make
compiling amalgalite3.c
clang: error: no such file or directory: '3'
make: *** [amalgalite3.o] Error 1
Any suggestions?
internal:lib/rubygems/custom_require:29:in require': no such file to load -- amalgalite/amalgalite (LoadError) from <internal:lib/rubygems/custom_require>:29:in
require'
from /home/mbaglay/.rvm/gems/ruby-2.2.0/gems/amalgalite-1.4.1/lib/amalgalite.rb:27:in rescue in <top (required)>' from /home/mbaglay/.rvm/gems/ruby-2.2.0/gems/amalgalite-1.4.1/lib/amalgalite.rb:22:in
<top (required)>'
from internal:lib/rubygems/custom_require:33:in require' from <internal:lib/rubygems/custom_require>:33:in
rescue in require'
from internal:lib/rubygems/custom_require:29:in `require'
Ruby 1.9.3. Problem is reproduced with all version of amalgalite.
Support of macruby may or may not be a priority for the project, but I thought reporting this may be of use.
require 'rubygems'
require 'amalgalite'
puts "using SQLite v#{Amalgalite::SQLite3::Version}"
I put that in amalgalite_test.rb and ran it with macruby on git master.
macruby amalgalite_test.rb
And I get:
"You are seeing something odd. The compiled version of SQLite that
is embedded in this extension is for some reason, not being used.
The version in the extension is 3.7.5 and the version that
as been loaded as a shared library is 3.6.12. These versions
should be the same, but they are not. โฆ"
Let me know if I can provide any more information.
It looks like amalgalite is not ready for Ruby 2.0 yet.
ruby 2.0.0p0 (2013-02-24) [i386-mingw32]
The generated file ext/amalgalite/amalgalite3_constants.c generates code that will not work on C compilers pre C99.
ext/gen_constants.rb needs to be updated to lay out all declarations before all statements.
Work around the differences here. The FasterCSV dependency should only exist for 1.8 since CSV ships with 1.9.
Start with a table with one data type as string (using sqlite command line 3.6.10 or better)
sqlite> create table test (id integer, name string)
sqlite> insert into test values (1, "Jay")
sqlite> insert into test values (2, "May")
From the ruby programming interface,
irb(main):036:0> db.execute("select * from test") do |row|
irb(main):037:1* puts row.to_s
irb(main):038:1> end
Amalgalite::Error: Unable to convert SQL type of string to a Ruby class
from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/type_maps/default_map.rb:99:in result_value_of' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:291:in
next_row'
from (irb):38:in each_with_index' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:261:in
each'
from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:261:in each_with_index' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:261:in
next_row'
from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/statement.rb:247:in each' from /usr/lib/ruby/gems/1.8/gems/amalgalite-0.10.0/lib/amalgalite/database.rb:292:in
execute'
from (irb):36
from :0
irb(main):039:0>
The software defect seems to be in line lib/amalgalite/type_maps/default_map.rb on line 27
'string' => %w[ text char varchar character ],
Line 27 should include 'string' in the list as well and probably say
'string' => %w[ string text char varchar character ],
Although I didn't test it there is probably also a bug in line 25, which says
'float' => %w[ double real numeric decimal ],
Line 25 should include "float" in the list and it should probably say,
'float' => %w[ float double real numeric decimal ],
Solving issue #16 showed that the way that Amalgalite represents the full schema of the connected database(s) is not proper. It needs to be more fully fleshed out. There are actually multiple schemas, one for the 'main' database, one for the 'temp' database and one for each 'attached' database.
The ability to represent all of these schemas is the goal. At the moment, there is just one 'Schema' and it is for the main, and the 'temp' schema is encapsulate within it. This is not the proper way to do this.
Changing the Schema API will result in a major version update as the API will not be backward compatible.
When packing amagalite into a database, it misses itself since the array amalgalite_needs is full path and Amalgalite::Packer.amalgalite_require_order is relative path
Hi,
Was that intentional that 1.7.0 platform version was released with ruby requirements being just "ruby >= 2.2.2", but mingw versions with ruby requirements "ruby >= 2.2.2 AND ruby < 2.7.dev"? That makes it impossible to install on 2.7 ruby installation.
If that was accidental, could you please release mingw versions without that additional requirement (it's ok if it's 1.7.1, I don't care about 1.7.0 specifically)?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.