GithubHelp home page GithubHelp logo

copiousfreetime / amalgalite Goto Github PK

View Code? Open in Web Editor NEW
94.0 7.0 20.0 16.73 MB

SQLite database engine embedded in a ruby extension.

License: Other

Ruby 2.26% C 97.73% Shell 0.01%
database embedded-database embedded-databases-wrapper ruby sqlite

amalgalite's People

Contributors

bmalex avatar copiousfreetime avatar dividedmind avatar ged avatar josb avatar regularfry avatar swistak35 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

amalgalite's Issues

Rework Schema API

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.

Amalgalite with MacRuby uses system different version.

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.

Can't run specs from gem

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)

no such file to load -- amalgalite/amalgalite (LoadError)

internal:lib/rubygems/custom_require:29:in require': no such file to load -- amalgalite/amalgalite (LoadError) from <internal:lib/rubygems/custom_require>:29:inrequire'
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:inrescue in require'
from internal:lib/rubygems/custom_require:29:in `require'

Ruby 1.9.3. Problem is reproduced with all version of amalgalite.

Gem install fails: "Use RbConfig instead of obsolete and deprecated Config"

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?

select statement through ruby interface fails when sqlite column data type is a "string"

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:innext_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:ineach'
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:innext_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:inexecute'
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 ],

Add Trigger Support

Amalgalite already has support for custom functions and aggregates - would it be possible to add support for triggers written in Ruby? Thanks -

making amagalite fails

"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

Instruction in README.md confusing

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

FasterCSV

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.

Different ruby compatibility depending on platform

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)?

Be more specific on checking sqlite $LOADED_FEATURES

$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"]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.