<    April 2017    >
Su Mo Tu We Th Fr Sa  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
00:15 graft_ joined
00:22 <graft_> hi all, i'm trying to alias the table name in my 'from' clause, but i can't figure out how to do it, e.g. i want SELECT * FROM "table_name" AS "alias_name"
00:23 <adam12> graft_: what do you have so far?
00:23 <graft_> i can alias tables in joins by doing join(:tablename___alias_name), but whatever model I'm joining to I dunno how to alias
00:23 <graft_> So if I do MyModel.where(whatever).all, I'm uncertain how to define a table alias for MyModel's table
00:24 <jeremyevans_> graft_: from(Sequel[:table_name].as(:alias_name))
00:24 <graft_> like MyModel.from().where()?
00:24 <jeremyevans_> graft_: yep
00:24 <jeremyevans_> graft_: assuming you only want the alias on a single dataset and not by default
00:25 <graft_> yah
00:26 <graft_> hmm, it says "undefined method [] for Sequel:Module"
00:27 <jeremyevans_> graft_: upgrade to the current version of Sequel :)
00:27 <graft_> version issue maybe? using 4.34
00:27 <jeremyevans_> graft_: or use Sequel.as(:table_name, :alias_name)
00:27 <jeremyevans_> graft_: that's almost a year old :)
00:28 <graft_> yeah... Gemfile.lock is both a blessing and a curse
00:29 <graft_> ok from(Sequel.as()) works!
00:29 <graft_> thanks a bunch... i always get such great help here :)
04:31 aidalgol joined
05:10 be_______ joined
05:12 ben__ joined
05:49 claw joined
06:33 claw joined
07:08 GitHub46 joined
07:08 <GitHub46> [13sequel] 15baelter opened issue #1339: undefined method `finish' for nil:NilClass during disconnect 02https://git.io/vS7rU
07:08 GitHub46 left
07:08 claw joined
07:13 GitHub67 joined
07:13 <GitHub67> [13sequel] 15baelter opened pull request #1340: fixes #1339 (06master...06master) 02https://git.io/vS7r3
07:13 GitHub67 left
07:34 claw joined
07:50 claw joined
08:26 claw joined
08:40 claw joined
08:57 claw joined
09:07 claw joined
09:38 claw joined
10:13 be_______ joined
10:15 be_______ joined
10:46 claw joined
11:08 claw joined
12:07 <foxxx0> how do i create bigints since ruby 2.4.0? Bignum is supposed to be deprecated or does this not apply for sequel migrations?
12:11 <foxxx0> ah, i see, just use Bignum() instead of column()?
12:13 <Caesium> see http://sequel.jeremyevans.net/rdoc/files/doc/release_notes/4_35_0_txt.html
12:13 <Caesium> it included changes related to this (very top)
12:14 <Caesium> you can use Bignum() in your migration, or change the Bignum constant in column, to :Bignum symbol
12:15 <foxxx0> okay
12:15 <foxxx0> is there a way to create columns as smallint?
12:15 <Caesium> I think if you pass any symbol or name sequel doesn't recognise it'll pass it straight through?
12:16 <Caesium> so just try :smallint, or smallint() :)
12:16 <Caesium> yep: https://github.com/jeremyevans/sequel/blob/master/doc/schema_modification.rdoc#column-types
12:16 <Caesium> (second example block)
12:16 <Caesium> 'In all other cases, Sequel uses the type specified verbatim'
12:17 <foxxx0> ah, so just quote it?
12:34 claw joined
12:54 claw joined
14:28 be_______ joined
14:30 ben__ joined
14:56 <foxxx0> hm
14:56 <foxxx0> NoMethodError: undefined method `drop_constraint' for #<Sequel::Postgres::Database:0x00000001e123b8>
14:56 <foxxx0> https://paste.foxxx0.de/u6HGG/
14:58 <foxxx0> backtrace: https://paste.foxxx0.de/UK1b7H/
14:59 <adam12> You likely need to be in an alter_table block
14:59 <adam12> Actually, maybe not
14:59 <foxxx0> ah
14:59 <adam12> ... hmm, yeah I think you do
14:59 <foxxx0> yeah
15:00 <foxxx0> yup
15:00 <foxxx0> thanks
16:45 claw joined
19:30 be_______ joined
20:30 claw joined
20:49 <flips> Any tips for a sample sequel based non-web program I can tear apart to pick up/learn nice habits/effective ways (preferably not too complex either)? (I'm using this holiday to gain some knowledge/proficiency.)
23:10 ben__ joined
23:12 ben__ joined
23:48 <adam12> flips: Nothing comes to mind. What kind of knowledge are you looking to acquire?
23:49 <adam12> For me, I've started looking more and more into the internals of SQL. I've always known a decent amount, but Sequel gives me some incredible power over my normal ActiveRecord