sequel Questions

1

Solved

I realized that I can't run the tutorial (http://sequel.jeremyevans.net/) twice. The first time, it runs as we expect. But the second time, it raises an error SQLite3::SQLException: table `items`...
Cuspid asked 4/9, 2014 at 4:25

2

Solved

I am using the pg_array extension and sequel version 4.1.1. I have added the extension like this: Sequel::Database.extension :pg_array I have created a column like this: alter_table :emails do...
Brakesman asked 2/5, 2014 at 19:40

1

Solved

Say I have a Sequel expression like: db.select(:id).from(:some_table).where(:foo => 5) Is there a way to get the SQL string that this will generate (i.e. "SELECT id FROM some_table WHERE foo ...
Gilbert asked 16/12, 2013 at 19:12

1

Solved

I am working on an application where a ruby sidekiq process calls a 3rd party and parses the data into a database. I am using sequel ad my orm. I am getting some weird characters back in the resu...
Wilhite asked 31/10, 2013 at 17:20

1

I am creating a Sequel migration to create a new table in my PostgreSQL database. I want to define a String array column, which PostgreSQL supports. My migration looks like this: create_table :ve...
Zootomy asked 16/7, 2013 at 13:30

2

Solved

I'm trying to make a local backup of the data from my Rails application, which is deployed to Heroku, and running into problems. I followed the taps instructions and installed Taps. I get two type...
Belanger asked 15/9, 2010 at 0:11

2

Solved

Using Sequel I'd like to join two subqueries together that share some column names, and then table-qualify those columns in the select. I understand how to do this if the two datasets are just tab...
Agathy asked 1/1, 2013 at 23:44

2

Solved

Using the Sequel gem: employees = DB[:prm_master__employee.identifier] .join(:prm_master__employee_custom_fields.identifier, :employee => :employee) .where("termination_date >= ?","06/01/201...
Isopiestic asked 3/12, 2012 at 8:11

1

Solved

In my (non-Rails) app, I'm trying to define a Sequel model: class Foo < Sequel::Model end When I run my app, I'm getting the error: No database associated with Sequel::Model: have you call...
Psychopharmacology asked 29/10, 2012 at 3:34

1

Solved

I want to define a SQL-command like this: SELECT * FROM WOMAN UNION SELECT * FROM MEN I tried to define this with the following code sequence in Ruby + Sequel: require 'sequel' DB = Sequel::Da...
Parkins asked 15/9, 2012 at 14:33

1

Solved

Given I have the following migration: Sequel.migration do up do alter_table :users do add_column :is_admin, :default => false end # Sequel runs a DESCRIBE table statement, when the model ...
Nalda asked 5/9, 2012 at 14:55

2

Solved

I am not clear yet on the proper way to run raw SQL queries with Sequel. Currently I am trying this: DB.fetch("SELECT * FROM zone WHERE dialcode = '#{@dialcode}' LIMIT 1") do |row| @zonename = r...
Hevesy asked 29/6, 2010 at 21:15

1

Solved

In ActiveRecord there is a default_scope class method to specify a default scope. For example class User < ActiveRecord::Base default_scope where(:deleted => false) end User.all # => SE...
Dendrology asked 26/7, 2012 at 13:0

5

Solved

I'm looking for a Ruby ORM to replace ActiveRecord. I've been looking at Sequel and DataMapper. They look pretty good however none of them seems to do the basic: not loading everything in memory wh...
Horotelic asked 13/1, 2012 at 10:47

3

heroku db:pull postgresql://root:@localhost/db_name After this command display this message /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/abstract_response.rb:50: warning: parenth...
Vitalis asked 1/10, 2010 at 16:40

3

Solved

I'd like to not store times in my local timezone, but Sequel is making it really tough on me. I can set them to UTC before I put them in there (a bit of a pain), but then when I take them back out ...
Papery asked 11/7, 2009 at 21:49

5

Solved

Summary Given a Hash, what is the most efficient way to create a subset Hash based on a list of keys to use? h1 = { a:1, b:2, c:3 } # Given a hash... p foo( h1, :a, :c, :d ) # ...create a method ...
Theme asked 13/4, 2011 at 17:10

2

Solved

I'm trying to understand the benefits of building SQL via an object-oriented builder DSL vs. parameterizing a raw SQL string. After researching/implementing the same query three ways, I notice that...
Rainproof asked 10/2, 2011 at 19:38

3

Attempting to pull my database from Heroku gives an error partway through the process (below). Using: Snow Leopard; heroku-1.8.2; taps-0.2.26; rails-2.3.5; mysql-5.1.42. Database is smallish, as y...
Pulchritudinous asked 30/3, 2010 at 21:5

2

Solved

In SQL it should look like this: SELECT * FROM `categories_description_old` WHERE ((`categories_description` = '') OR (`categories_name` = '') OR (`categories_heading_title` = '')) My (ugly) sol...
Giblets asked 15/11, 2010 at 15:28

1

Solved

The default Ruby Sequel behaviour is to log all DB queries at the INFO level (unlike ActiveRecord which logs at the DEBUG level). How do I change this?
Vinous asked 5/10, 2010 at 17:40

3

Solved

Checked ActiveRecord, DataMapper, Sequel: some use globals (static variables) some require open db connection before loading source file with models. What ORM is better to use in sinatra applicatio...
Cheeseburger asked 14/4, 2010 at 18:19

1

Solved

I mean the one which was previously established as DB = Sequel.sqlite('my_blog.db') or DB = Sequel.connect('postgres://user:password@localhost/my_db') or DB = Sequel.postgres('my_db', :user ...
Colis asked 6/5, 2010 at 18:8

6

Solved

A colleague of mine is currently designing SQL queries like the one below to produce reports, which are displayed in excel files through an external data query. At present, only reporting processes...
Audette asked 15/1, 2010 at 17:23

2

Solved

I'm considering using Sequel for some of my hairier SQL that I find too hard to craft in Active Record. Are there any things I need to be aware of when using Sequel and ActiveRecord on the same p...
Viccora asked 5/8, 2009 at 23:45

© 2022 - 2024 — McMap. All rights reserved.