Questions tagged [sqlite3-ruby]

The low level SQLite3 library for Ruby. This should only be used for questions about using the low level interface directly.

The SQLite3 gem provides low level Ruby bindings to the SQLite3 embedded database.

You must have the SQLite engine installed in order to build this module.

Links:

214 questions
0
votes
1 answer

How can I prepare a query with variable amounts of WHERE expressions?

I have a query that looks like this: SELECT sn.name, -- Street name sa.house_number, -- House number sa.entrance, -- Entrance pc.postal_code, -- Postal code ci.name, -- City mu.name, --…
Hubro
  • 56,214
  • 69
  • 228
  • 381
0
votes
0 answers

Rails database and forms

If I have a form that has a text_field called title and a text_area called text and In my database I generated a model called post with a text:string, text:text how do they relate? I'm going over the Rails guide and am a little confused on this.…
equaltwelve
  • 32
  • 1
  • 6
0
votes
1 answer

Setting post parameters in Sinatra with data from an API

I want to have a GET route that will query an API to collect data, and then redirect to a POST with that data to save to the DB. For example: get '/query/twitter/company/:name' do get_number_of_tweets_for_day( params[:name] ) end POST…
earlygrey
  • 11
  • 3
0
votes
1 answer

I cannot install the SQLite3 Gem in my bundle for rails (I can install it as a gem, but not in my gemfile)?

I have been going through a lot of trouble trying to get the SQLite gem working in my Rails project. After a lot of looking, I found a tutorial to help fix my problem, at least, I though it would fix my problem. It let me actually install the gem,…
0
votes
1 answer

SQL delete all id paths of a model table

Just deleted my all my model tables by (Setting.delete_all). But when I create a new setting it starts from id 12. How do i delete the ids of the "deleted settings"? I want to delete everything so that I start from setting/1 when I create a new…
fynn
  • 143
  • 2
  • 17
0
votes
1 answer

assigning values to model

I'm kinda new to coding on rails. It would be great if you could help me out with what I think might be noob question.Here's my code: def create @project = Project.new(params[:project]) if @project.save redirect_to…
Alok Mysore
  • 606
  • 3
  • 16
0
votes
1 answer

How to query a rails model with an array

Hello people of stack overflow I am relatively new to the rails platform and needed some help with model querying Here is my code: def create @project = Project.new(params[:project]) if @project.save redirect_to…
Alok Mysore
  • 606
  • 3
  • 16
0
votes
1 answer

NoMethodError: undefined method `Amount' for nil:NilClass

:031:0> @revenue = Revenue.where(:Year=>1983) ←[1m←[36mRevenue Load (1.0ms)←[0m ←[1mSELECT "revenues".* FROM "revenues" WHERE "revenues"."Year" = 1983←[0m => [#
Hrishikesh Sardar
  • 2,907
  • 4
  • 21
  • 33
0
votes
2 answers

Heroku db:pull error LoadError: cannot load such file — sqlite3 (Sequel::AdapterNotFound)

I'm having the same problem as this person: Heroku db:pull error "LoadError: cannot load such file -- sqlite3 (Sequel::AdapterNotFound)" Where I cannot pull my database from heroku. However gem install sqlite3, gem install taps, and installing…
ThinQtv
  • 103
  • 1
  • 1
  • 11
0
votes
1 answer

Creating database for an iOS application

I'm coding an application for iOS. Which approach do you think is better: creating tables (create table foo) and everything at once, or only create the tables when it's necessary (only when the user goes to a certain view that uses that table) ? My…
andrefurquin
  • 502
  • 6
  • 17
0
votes
3 answers

JRuby and SQLite3

I'm trying to make work JRuby and SQLite3 with the following gems: bouncy-castle-java (1.5.0146.1) bundler (1.3.2) dbd-jdbc (0.1.6 java) dbi (0.4.5) deprecated (2.0.1) jdbc-sqlite3 (3.7.2.1) jruby-launcher (1.0.15 java) jruby-openssl (0.8.2) json…
GlinesMome
  • 1,549
  • 1
  • 22
  • 35
0
votes
1 answer

Ruby on rails, the ways to speed up search in database

I have the table products with following fields: code - string, id - integer My table has over 5 million rows. In the model I use code: find(:all, :conditions => ['code = ?', "#{search}"]) It takes 2 seconds to find the result. Is there any way to…
BoredT
  • 1,590
  • 15
  • 19
0
votes
2 answers

How to install ROR to ubuntu 12.04 ? Getting error with sqlite3

I'm new in ROR. So when I'm trying to install ROR. when I try to start rails(rails s) I get such error: Could not find gem 'sqlite3 (>= 0) ruby' in the gems available on this machine. Run `bundle install` to install missing gems. P.S. I'm…
0
votes
2 answers

Sqlite3 in ruby on rails and cmd

I have a table with name buildings and I want to drop it because i forgot a column. In cmd I go to the folder and type "sqlite3" then ".tables" and nothing shows me. why that? and what can i do?
marios
  • 261
  • 8
  • 26
0
votes
1 answer

How can I resolve the DataObjects::ConnectionError when running with data_mapper (Ruby 1.8.7)

When I run this code require 'rubygems' require 'data_mapper' require "sqlite3" DataMapper::setup(:default, "sqlite3://#{Dir.pwd}./prod.db") class Person include DataMapper::Resource property :id, Serial def initialize(name) self[:name]…
JoeyC
  • 764
  • 11
  • 19