Questions tagged [sequel]

Sequel is a database toolkit for the Ruby programming language that provides abstractions over many SQL RDBMS.

Sequel is a "Database Toolkit for Ruby" that:

  • ...provides thread safety, connection pooling and a concise DSL for constructing SQL queries and table schemas.

  • ...includes a comprehensive ORM layer for mapping records to Ruby objects and handling associated records.

  • ...supports advanced database features such as prepared statements, bound variables, stored procedures, savepoints, two-phase commit, transaction isolation, master/slave configurations, and database sharding.

  • ...has adapters for ADO, Amalgalite, DataObjects, DB2, DBI, Firebird, Informix, JDBC, MySQL, Mysql2, ODBC, OpenBase, Oracle, PostgreSQL, SQLite3, and Swift.

See the documentation for a list of guides, examples, tutorials, and other reference material.

Sequel is currently maintained and primarily developed by Jeremy Evans.

735 questions
-1
votes
1 answer

Sequel Ruby reading bytea data type

I am trying to decode a json mime type stored in bytea column in postgres using sequel. I remember I used some kind of method passing it mime type and data. But I cannot find it in my code and documentation. I have bytea column and info about mime…
Levi
  • 87
  • 7
-1
votes
1 answer

import large .SQL files with Ruby sequel gem

I am Looking to import(Rather run the schema.sql and seed.sql) in to the SQL server database using sequel gem. Is it possible with the gem? I did some very basic things like creating a database, running few queries etc. But Can not find any example…
jnan
  • 13
  • 3
-1
votes
1 answer

Sequel Dataset Aggregate Count

I'm trying to count the fields in a table, and the returned SQL isn't generated properly. What am I doing wrong? ds is the dataset: term = 'abouts' puts ds.count(:id).where(kind: term) # => app.rb:179:in `
': undefined method `where'…
Rich_F
  • 1,287
  • 3
  • 15
  • 38
-1
votes
1 answer

How to add multiple columns in Sequel

In this example: require 'rubygems' require 'sqlite3' require 'sequel' db = SQLite3::Database.new "fruits.db" db2 = Sequel.sqlite("fruits.db") db.execute 'CREATE TABLE "fruit" ("box_id" INTEGER, "apples" INTEGER, "oranges" INTEGER, "total"…
stephen
  • 195
  • 9
-1
votes
1 answer

Can't join and select in Sequel -- PG::SyntaxError

I'm trying to rename a column at join: # ............... result = DB[:my_items1].join(:my_items2, id: :my_item2_id). select([Sequel[:my_items2][:name].as(:my_items_name), …
Oaemirami
  • 27
  • 4
-1
votes
1 answer

Sequel SELECT count(id) FROM tablename WHERE username = "alpha"

I can't seem to get this query right. Sequel implementation of: SELECT count(id) FROM users WHERE username = "alpha" AND status = "new" Here's what I have so far: db = Sequel.connect('postgres://me:pw@0.0.0.0:5432/dbname) u = db[:users] puts…
Rich_F
  • 1,287
  • 3
  • 15
  • 38
-1
votes
1 answer

I am trying to extract data from previous day in SAS

Is there proc sql code using CURRENT_DATE that I can subtract one day from it in order to extract data from the previous day? I am trying to automate a report and need the ability to extract data from the previous day.
lwc0724
  • 1
  • 1
-1
votes
1 answer

Does ruby sequel support the JSON datatype which Mysql 5.7 introduced?

It does not appear the ruby based sequel toolkit (currently at v4.32.0 I believe) supports the JSON datatype which mysql introduced with v5.7. Can somebody confirm that is true and suggests workarounds for migrations and queries? Also whether there…
ynkr
  • 20,186
  • 4
  • 30
  • 30
-1
votes
1 answer

Add all possible record as association

Question: Is there opposite of remove_all_ in Ruby Sequel Background: I have two models (let's say car and factory ) with association between them. I am able to remove all cars from factory (factory.remove_all_cars) but in front-end user also has…
Mailo Světel
  • 17,483
  • 5
  • 27
  • 40
-1
votes
1 answer

Is Rails Enterprise Friendly? ActiveRecord seems selfish

I have been learning Rails since this summer and have written some successful standalone apps with it, and really have grown to appreciate nearly everything about Rails. However, my current project is writing Rails as a front-end to a database that…
Atari2600
  • 1,159
  • 2
  • 12
  • 24
-1
votes
1 answer

JSON:ParseError in ruby

i am using sequel and json gem in ruby when i try to converting a record into json object and trying to get its fields my code is require 'json' require "rubygems" require "sequel" require 'yaml' require "sequel/extensions/pg_array" DB =…
Ritesh Mehandiratta
  • 6,595
  • 28
  • 114
  • 186
-1
votes
1 answer

undefined method `[]' for nil:NilClass (NoMethodError)

i am using sequel gem and postgresql database i have a file hello.rb with code require "rubygems" require './post' require "sequel" # connect to an in-memory database DB = Sequel.connect('postgres://ritesh:newpassword@localhost') post =…
Ritesh Mehandiratta
  • 6,595
  • 28
  • 114
  • 186
-2
votes
1 answer

How to write migration create table with options (DISTRIBUTE BY HASH(id)) for Sequel / Ruby

How to write migration create table with options like DISTRIBUTE BY HASH(id) for Sequel Example in Ruby create_table(:table_name) do primary_key :id column :column_name, :text end Вesired result in SQL CREATE TABLE "table_name" ( "id" serial…
Andrew Zhuk
  • 464
  • 8
  • 22
-2
votes
2 answers

How to send raw query string using Sequel

I just installed the "Sequel" gem. I know that there are a lot of methods that make SQL easier, but I think that's just confusing. Is there a way to send a raw SQL query so that: table.all would be? "SELECT * FROM table"
Sessho
  • 167
  • 7
-4
votes
2 answers

How to group combined AND with OR statements using the Sequel GEM in Ruby?

I am fairly good at PHP (OOP & flat). And for the past year or so I have been tasked with maintaining a Ruby codebase; a skill I am still learning. I am not too clear on how to properly structure a filtering chain using Sequel so AND as well OR…
Giacomo1968
  • 23,903
  • 10
  • 59
  • 92
1 2 3
48
49