sqlite3 1.3.11-x64-mingw32 → 1.5.0.rc1-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +5 -5
  2. data/.gemtest +0 -0
  3. data/{API_CHANGES.rdoc → API_CHANGES.md} +3 -4
  4. data/CHANGELOG.md +419 -0
  5. data/CONTRIBUTING.md +24 -0
  6. data/Gemfile +2 -15
  7. data/LICENSE-DEPENDENCIES +20 -0
  8. data/README.md +233 -0
  9. data/ext/sqlite3/aggregator.c +273 -0
  10. data/ext/sqlite3/aggregator.h +12 -0
  11. data/ext/sqlite3/database.c +210 -182
  12. data/ext/sqlite3/database.h +2 -0
  13. data/ext/sqlite3/exception.c +6 -2
  14. data/ext/sqlite3/extconf.rb +148 -39
  15. data/ext/sqlite3/sqlite3.c +67 -1
  16. data/ext/sqlite3/sqlite3_ruby.h +0 -7
  17. data/ext/sqlite3/statement.c +15 -20
  18. data/faq/faq.md +431 -0
  19. data/faq/faq.yml +1 -1
  20. data/lib/sqlite3/2.6/sqlite3_native.so +0 -0
  21. data/lib/sqlite3/2.7/sqlite3_native.so +0 -0
  22. data/lib/sqlite3/3.0/sqlite3_native.so +0 -0
  23. data/lib/sqlite3/constants.rb +2 -1
  24. data/lib/sqlite3/database.rb +209 -58
  25. data/lib/sqlite3/errors.rb +1 -10
  26. data/lib/sqlite3/pragmas.rb +372 -57
  27. data/lib/sqlite3/resultset.rb +2 -10
  28. data/lib/sqlite3/statement.rb +2 -1
  29. data/lib/sqlite3/translator.rb +1 -1
  30. data/lib/sqlite3/version.rb +4 -4
  31. data/lib/sqlite3.rb +5 -0
  32. data/test/helper.rb +9 -0
  33. data/test/test_database.rb +180 -9
  34. data/test/test_database_flags.rb +95 -0
  35. data/test/test_database_readonly.rb +9 -2
  36. data/test/test_database_readwrite.rb +41 -0
  37. data/test/test_integration.rb +12 -77
  38. data/test/test_integration_aggregate.rb +336 -0
  39. data/test/test_integration_resultset.rb +0 -17
  40. data/test/test_sqlite3.rb +16 -0
  41. data/test/test_statement.rb +12 -9
  42. metadata +55 -84
  43. data/CHANGELOG.rdoc +0 -287
  44. data/Manifest.txt +0 -52
  45. data/README.rdoc +0 -101
  46. data/Rakefile +0 -10
  47. data/lib/sqlite3/2.0/sqlite3_native.so +0 -0
  48. data/lib/sqlite3/2.1/sqlite3_native.so +0 -0
  49. data/lib/sqlite3/2.2/sqlite3_native.so +0 -0
  50. data/setup.rb +0 -1333
  51. data/tasks/faq.rake +0 -9
  52. data/tasks/gem.rake +0 -38
  53. data/tasks/native.rake +0 -52
  54. data/tasks/vendor_sqlite3.rake +0 -97
data/tasks/faq.rake DELETED
@@ -1,9 +0,0 @@
1
- # Generate FAQ
2
- desc "Generate the FAQ document"
3
- task :faq => ['faq/faq.html']
4
-
5
- file 'faq/faq.html' => ['faq/faq.rb', 'faq/faq.yml'] do
6
- cd 'faq' do
7
- ruby "faq.rb > faq.html"
8
- end
9
- end
data/tasks/gem.rake DELETED
@@ -1,38 +0,0 @@
1
- begin
2
- require 'hoe'
3
- rescue LoadError
4
- # try with rubygems?
5
- require 'rubygems'
6
- require 'hoe'
7
- end
8
-
9
- Hoe.plugin :debugging, :doofus, :git, :minitest, :bundler
10
-
11
- HOE = Hoe.spec 'sqlite3' do
12
- developer 'Jamis Buck', 'jamis@37signals.com'
13
- developer 'Luis Lavena', 'luislavena@gmail.com'
14
- developer 'Aaron Patterson', 'aaron@tenderlovemaking.com'
15
-
16
- license "BSD-3"
17
-
18
- self.readme_file = 'README.rdoc'
19
- self.history_file = 'CHANGELOG.rdoc'
20
- self.extra_rdoc_files = FileList['*.rdoc', 'ext/**/*.c']
21
-
22
- require_ruby_version ">= 1.8.7"
23
- require_rubygems_version ">= 1.3.5"
24
-
25
- spec_extras[:extensions] = ["ext/sqlite3/extconf.rb"]
26
-
27
- extra_dev_deps << ['rake-compiler', "~> 0.9.3"]
28
- extra_dev_deps << ['rake-compiler-dock', "~> 0.4.3"]
29
- extra_dev_deps << ["mini_portile", "~> 0.6.2"]
30
- extra_dev_deps << ["minitest", "~> 5.0"]
31
- extra_dev_deps << ["hoe-bundler", "~> 1.0"]
32
-
33
- clean_globs.push('**/test.db')
34
- end
35
-
36
- Hoe.add_include_dirs '.'
37
-
38
- # vim: syntax=ruby
data/tasks/native.rake DELETED
@@ -1,52 +0,0 @@
1
- # use rake-compiler for building the extension
2
- require 'rake/extensiontask'
3
- require 'rake/extensioncompiler'
4
-
5
- # NOTE: version used by cross compilation of Windows native extension
6
- # It do not affect compilation under other operating systems
7
- # The version indicated is the minimum DLL suggested for correct functionality
8
- BINARY_VERSION = "3.8.11.1"
9
- URL_VERSION = "3081101"
10
- URL_PATH = "/2015"
11
-
12
- task :devkit do
13
- begin
14
- require "devkit"
15
- rescue LoadError => e
16
- abort "Failed to activate RubyInstaller's DevKit required for compilation."
17
- end
18
- end
19
-
20
- # build sqlite3_native C extension
21
- RUBY_EXTENSION = Rake::ExtensionTask.new('sqlite3_native', HOE.spec) do |ext|
22
- # where to locate the extension
23
- ext.ext_dir = 'ext/sqlite3'
24
-
25
- # where native extension will be copied (matches makefile)
26
- ext.lib_dir = "lib/sqlite3"
27
-
28
- # clean binary folders always
29
- CLEAN.include("#{ext.lib_dir}/?.?")
30
-
31
- # automatically add build options to avoid need of manual input
32
- if RUBY_PLATFORM =~ /mswin|mingw/ then
33
- # define target for extension (supporting fat binaries)
34
- RUBY_VERSION =~ /(\d+\.\d+)/
35
- ext.lib_dir = "lib/sqlite3/#{$1}"
36
- else
37
-
38
- # detect cross-compiler available
39
- begin
40
- Rake::ExtensionCompiler.mingw_host
41
- ext.cross_compile = true
42
- ext.cross_platform = ['i386-mswin32-60', 'i386-mingw32', 'x64-mingw32']
43
- rescue RuntimeError
44
- # noop
45
- end
46
- end
47
- end
48
-
49
- # ensure things are compiled prior testing
50
- task :test => [:compile]
51
-
52
- # vim: syntax=ruby
@@ -1,97 +0,0 @@
1
- require "rake/clean"
2
- require "rake/extensioncompiler"
3
- require "mini_portile"
4
-
5
- CLOBBER.include("ports")
6
-
7
- directory "ports"
8
-
9
- def define_sqlite_task(platform, host)
10
- recipe = MiniPortile.new "sqlite3", BINARY_VERSION
11
- recipe.files << "http://sqlite.org#{URL_PATH}/sqlite-autoconf-#{URL_VERSION}.tar.gz"
12
- recipe.host = host
13
-
14
- desc "Compile sqlite3 for #{platform} (#{host})"
15
- task "ports:sqlite3:#{platform}" => ["ports"] do |t|
16
- checkpoint = "ports/.#{recipe.name}-#{recipe.version}-#{recipe.host}.installed"
17
-
18
- unless File.exist?(checkpoint)
19
- cflags = "-O2 -DSQLITE_ENABLE_COLUMN_METADATA"
20
- cflags << " -fPIC" if recipe.host && recipe.host.include?("x86_64")
21
- recipe.configure_options << "CFLAGS='#{cflags}'"
22
- recipe.cook
23
- touch checkpoint
24
- end
25
- end
26
-
27
- recipe
28
- end
29
-
30
- # native sqlite3 compilation
31
- recipe = define_sqlite_task(RUBY_PLATFORM, RbConfig::CONFIG["host"])
32
-
33
- # force compilation of sqlite3 when working natively under MinGW
34
- if RUBY_PLATFORM =~ /mingw/
35
- RUBY_EXTENSION.config_options << "--with-opt-dir=#{recipe.path}"
36
-
37
- # also prepend DevKit into compilation phase
38
- Rake::Task["compile"].prerequisites.unshift "devkit", "ports:sqlite3:#{RUBY_PLATFORM}"
39
- Rake::Task["native"].prerequisites.unshift "devkit", "ports:sqlite3:#{RUBY_PLATFORM}"
40
- end
41
-
42
- # trick to test local compilation of sqlite3
43
- if ENV["USE_MINI_PORTILE"] == "true"
44
- # fake recipe so we can build a directory to it
45
- recipe = MiniPortile.new "sqlite3", BINARY_VERSION
46
- recipe.host = RbConfig::CONFIG["host"]
47
-
48
- RUBY_EXTENSION.config_options << "--with-opt-dir=#{recipe.path}"
49
-
50
- # compile sqlite3 first
51
- Rake::Task["compile"].prerequisites.unshift "ports:sqlite3:#{RUBY_PLATFORM}"
52
- end
53
-
54
- # iterate over all cross-compilation platforms and define the proper
55
- # sqlite3 recipe for it.
56
- if RUBY_EXTENSION.cross_compile
57
- config_path = File.expand_path("~/.rake-compiler/config.yml")
58
- if File.exist?(config_path)
59
- # obtains platforms from rake-compiler's config.yml
60
- config_file = YAML.load_file(config_path)
61
-
62
- Array(RUBY_EXTENSION.cross_platform).each do |platform|
63
- # obtain platform from rbconfig file
64
- config_key = config_file.keys.sort.find { |key|
65
- key.start_with?("rbconfig-#{platform}-")
66
- }
67
- rbfile = config_file[config_key]
68
-
69
- # skip if rbconfig cannot be read
70
- next unless File.exist?(rbfile)
71
-
72
- host = IO.read(rbfile).match(/CONFIG\["CC"\] = "(.*)"/)[1].sub(/\-gcc/, '')
73
- recipe = define_sqlite_task(platform, host)
74
-
75
- RUBY_EXTENSION.cross_config_options << {
76
- platform => "--with-opt-dir=#{recipe.path}"
77
- }
78
-
79
- # pre-compile sqlite3 port when cross-compiling
80
- task :cross => "ports:sqlite3:#{platform}"
81
- end
82
- else
83
- warn "rake-compiler configuration doesn't exist, but is required for ports"
84
- end
85
- end
86
-
87
- task :cross do
88
- ["CC", "CXX", "LDFLAGS", "CPPFLAGS", "RUBYOPT"].each do |var|
89
- ENV.delete(var)
90
- end
91
- end
92
-
93
- desc "Build windows binary gems per rake-compiler-dock."
94
- task "gem:windows" do
95
- require "rake_compiler_dock"
96
- RakeCompilerDock.sh "bundle && rake cross native gem MAKE='nice make -j`nproc`'"
97
- end