<    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:09 kith joined
02:11 tercenya joined
03:15 glennpratt joined
03:25 pdrakeweb joined
03:46 claw joined
04:28 glennpra_ joined
04:44 glennpratt joined
05:38 jaequery joined
06:19 nirvdrum joined
07:21 glennpratt joined
07:54 glennpratt joined
09:24 aidalgol joined
09:50 <foxxx0> hey, I want to use sequel with a larger raw sql statement as a prepared statement, prepare this once at application boot and then just use it afterwards
09:53 <foxxx0> if I'm not mistaken, I first need to initialize a DB handle through Sequel.connect, then create a dataset with my query using ds = DB[query, $:var1, $:var2, ...] and finally create a prepared statement using ps = ds.prepare(:select, query, $:var1, ...) so that i can later use it via ps.call(var1: 'foo', var2: 'bar')?
10:23 <foxxx0> so
10:23 <foxxx0> https://paste.foxxx0.de/iQCdq/
10:23 <foxxx0> this is not working, it fails at the ps.call
10:23 <foxxx0> i suppose I'm doing something wrong, I just don't know what :D
10:24 <foxxx0> (this is a simplified example query)
10:24 <foxxx0> > PG::SyntaxError: ERROR: syntax error at end of input
10:24 <foxxx0> LINE 1: ...lue_avg, m.value_best FROM "Measurements" m WHERE m.type = ?
10:24 <foxxx0> right after the ?
10:25 <foxxx0> full backtrace: https://paste.foxxx0.de/RKSSCO/
10:33 <foxxx0> nvm
10:33 <foxxx0> figured it out
10:33 <foxxx0> this looks like the solution: https://paste.foxxx0.de/Xj5m78/
14:40 Bish joined
14:51 <bougyman> hrm.
14:51 <bougyman> I don't know how to use an array field in a where in Sequel
14:51 <bougyman> I guess this is the first time i've tried.
14:51 <bougyman> can't do .where(field: ['value']) nor .where(field: 'value')
14:52 <bougyman> jeremyevans: ^ ? (or anyone who knows, google's not helping)
14:53 <Bish> bougyman: what do you mean by saying array field, like postgres arrays?
14:57 glennpratt joined
15:08 <bougyman> yes.
15:09 <bougyman> PGArray
15:09 <Caesium> there's a pg_array and pg_array_ops extension you can use for this
15:09 <Caesium> http://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/pg_array_ops_rb.html
15:09 <bougyman> I have it.
15:09 <bougyman> ah, that's the link I just found
15:10 <bougyman> doesn't show how to query it, though
15:11 <bougyman> ataset.where(1=>array_op.any)
15:11 <bougyman> i see
15:11 <jeremyevans> bougyman: .where(Sequel.pg_array(:field).contains(['value']))
15:13 <bougyman> gah, still cant figure it out.
15:13 <bougyman> aha
15:13 <bougyman> thanks
15:13 <bougyman> Sequel.extension :pg_array_ops
15:14 <Caesium> I'm just trying to find where in the docs this is tbh :)
15:14 <Caesium> I don't think I'm the only person to find the vastness of Sequel's docs confusing
15:14 <jeremyevans> Caesium: http://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/pg_array_ops_rb.html
15:14 <jeremyevans> Caesium: certainly you aren't the only one. I'm open to suggestions on reorganization
15:19 <bougyman> nah, if I kept looking long enough I'd haev found it.
15:50 <Bish> <3 postgres
17:01 fideliz joined
17:08 <fideliz> Hi guys
17:08 <fideliz> I need some help
17:08 <fideliz> I ve cloned the project, but I cant run the specs, I'm trying: `rake spec`
17:08 <fideliz> "/(..)/sequel/spec/deprecation_helper.rb:1:in `<top (required)>': uninitialized constant Sequel::Deprecation (NameError)"
17:09 <fideliz> I required manually sequel/deprecated.rb, but another errors appeared anoybody y have some clue about this?
17:09 <fideliz> somebody*
17:17 <adam12> sigh
17:22 banditro_ joined
17:24 jaequery joined
17:28 Renich joined
18:04 tercenya joined
18:37 <flips> patient people ... ;)
18:47 <adam12> :)
18:47 <adam12> I didn't have an answer for them anyways - rake spec works great here.
18:47 <adam12> but I was installing dependencies to confirm, when they bailed.
18:53 <* flips> is rather blank on Rakefile/rake syntax ... looking into making one for sqlite3 instead of PG (looking at the ./lib/tasks/database.rb example at http://mrcook.uk/simple-roda-blog-tutorial, guess I'll have to change self.create_db and self.drop_db...)
18:55 <adam12> I wrote batteries, but I am not sure how it will work with sqlite?
18:55 <adam12> https://github.com/adam12/batteries
18:55 <adam12> (still a WIP but I'm using it)
18:57 <flips> Do you have a full usage example with pg/mysql/whatever you prefer? :)
18:57 <adam12> Not really - just the instructions of the README
18:57 <adam12> It's similar to the roda-sequel-stack app of jeremyevans
18:58 <adam12> It makes a few presumptions - your Sequel DB object is initialized in db.rb, and your migrations are in ./migrate/
19:02 jaequery joined
19:02 <flips> ooh, https://github.com/jeremyevans/roda-sequel-stack, just what I was looking for :)
19:41 tercenya joined
19:47 tercenya joined
23:19 Renich___ joined
23:27 glennpratt joined