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
1
vote
2 answers

How do you completely remove sqlite3?

I tried doing this gem uninstall sqlite3-ruby gem uninstall sqlite3 Then I performed find ~/ | grep mkmf.log And it removed any sqlite3 directory I had on the system. But it still is in my bin. Anyone know a more professional way of removing…
Trip
  • 26,756
  • 46
  • 158
  • 277
1
vote
1 answer

SQLite3::ConstraintException: FOREIGN KEY constraint failed: DROP TABLE users

How to disable(I don't know the correct term yet) foreign keys before DROP TABLE? OR correct way to drop a table? followed steps provided here Image link got the same error again SQLite3::ConstraintException: FOREIGN KEY constraint failed: DROP…
robincEPtion
  • 47
  • 2
  • 10
1
vote
1 answer

Creating a table categorization with has_many :through for categories and posts

Hey guys I'm doing a has_many :through association in ruby on rails. And I want some help if it's ok with my example. So I pretend to do categories for Posts. Supposing I already have builded the class post. So for create the database for…
rld
  • 2,603
  • 2
  • 25
  • 39
1
vote
1 answer

sqlite mode column and header on, in ruby script

You know certainly about .mode column & headers on, to show datas of a sqlite database. But how to obtain the same result wth in Ruby script? For example, to add it to my own script: begin require 'sqlite3' db =…
1
vote
1 answer

Ruby Syntax for finding same foreign key values in different tables

I have a table (peas) containing several foreign keys in each row and listing them in it's index view. I have other tables (carrots) that contain the same foreign keys. From the first table (peas) I want to find the row in the other table (carrots)…
1
vote
0 answers

What is the conceptual difference between User.first.followers.count and User.first.followers.to_a.count?

The two Active Record queries: User.first.followers.count and User.first.followers.to_a.count evaluate to the following SQL queries respectively: [4] pry(main)> User.first.followers.count User Load (0.2ms) SELECT "users".* FROM "users" ORDER BY…
mbigras
  • 7,664
  • 11
  • 50
  • 111
1
vote
0 answers

Ruby sqlite3 LIKE not working as expected

This is the situation, I have a simple table: > DB.execute("CREATE TABLE IF NOT EXISTS webserver(id INTEGER PRIMARY > KEY AUTOINCREMENT, url varchar(1000), server_name varchar(1000));") I have just one record in the table: SELECT * FROM webserver;…
Recoba20
  • 314
  • 1
  • 13
1
vote
1 answer

can we use schema file or seed file to create database file on ruby on rails project?

I am working on rubyRails project. In db folder it contains schema file, seed file and .sqlite3 file but this database is zero kb.I want create database using this schema or seed file. Any idea
Harry
  • 137
  • 1
  • 2
  • 5
1
vote
2 answers

How to install ruby interface for sqlite3 in Mac snow leopard?

I tried to install it as below but it throws error :- "sudo gem install sqlite3-ruby" Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native…
Hemanth
  • 5,035
  • 9
  • 41
  • 59
1
vote
1 answer

sqlite3 install issues on mac os sierra

Hi I am very new at what im doing here. I have tried following a couple different install guides for installing ruby on rails and seem to get stuck at the same point each time and it has to do with sqlite3 it gives me an error message that looks…
C Wagner
  • 11
  • 3
1
vote
1 answer

How to compile sqlite3, mysql and postgres driver for Rails 3.X on Mac OS X Leopard?

Is there a reason why all sqlite3, mysql, postgres driver compiles on Mac OS X Leopard when it is Rails 2.3.8, but can't compile when it is Rails 3.x? Theoretically, isn't it just some compile flags to make them work? (They all compile on Snow…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
1
vote
1 answer

How to extract data from sqlite3 array in ruby on rails?

How can I get data from an array of the form: [#] generated from sqlite3 database using this…
hack-is-art
  • 325
  • 5
  • 20
1
vote
1 answer

Accessing SQLite3 modes from Ruby

I came across various similar questions, but I can't figure it out. how to I use the .import command from ruby? I mean, when you run the sqlite3, you can type in commands, like this: sqlite3> .import file table so, how can i import file this way…
user_pruser
  • 422
  • 2
  • 13
1
vote
1 answer

Failure to push to heroku! (Micharl Hartle Rails Tutorial 3 - Sample App)

Note: Absolute beginner. I note that most answers to similar questions state that SQlite3 does not work with Heroku, and recommend using PostgreSQL. Before making any changes in that direction, I wanted to know if doing so would affect my ability to…
1
vote
1 answer

Don't work "db.results_as_hash = true" in Ruby

I connect to database and change db.results_as_hash to true db = SQLite3::Database.new 'barbershop.sqlite' db.results_as_hash = true But it don't display hash, it is simple array. And don't work <% @results.each do |row| %> …
Evgeny Palguev
  • 599
  • 3
  • 18