← Back to team overview

mvhub-dev team mailing list archive

Database Agnostic Chat (omacneil, jbonhag, roger, emaad)

 

(10:42:11 AM)*omacneil_gmail.com [/omacneil@xxxxxxxxx/TalkGadget952BDB0B/] entered the room.*
(10:42:11 AM)*emaadmanzoor_gmail.com entered the room.*
(10:42:40 AM)*bonhagjeffrey:*Hello everybody!
(10:43:22 AM)*omacneil_gmail.com:*Hola
(10:43:37 AM)*emaadmanzoor_gmail.com:*hey jeff
(10:43:42 AM)*bonhagjeffrey:*Hi Emaad
(10:43:55 AM)*omacneil_gmail.com:*: http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Example.pod shared Emaad (10:45:03 AM)*bonhagjeffrey:*yeah, we were talking about stuff yesterday and it looks like it really makes sense to do something like this
(10:45:29 AM)*bonhagjeffrey:*or to only use universally-understood SQL
(10:45:46 AM)*bonhagjeffrey:*and maybe sequences would be generated by Perl
(10:46:49 AM)*emaadmanzoor_gmail.com:*Jeff: In this example, they're doing the initial database population in SQL. Would it be possible to do that using Perl/DBIx too?
(10:47:45 AM)*roger.wieand_gmail.com entered the room.*
(10:48:24 AM)*omacneil_gmail.com:*I just invited Roger to the chat as he's here physically , he's mostly here for background / lurking
(10:48:31 AM)*roger.wieand_gmail.com:*hi!
(10:48:54 AM)*emaadmanzoor_gmail.com:*Hi Roger
(10:49:14 AM)*omacneil_gmail.com:*on the Chat are Emaad (working on packaging) Jeff (working on database abastraction) me Roger (just getting started)
(10:50:09 AM)*bonhagjeffrey:*Hi Roger
(10:50:19 AM)*omacneil_gmail.com:*Jeff, I was telling Emaad that I don't have enough information to have a valid opinioni
(10:50:31 AM)*omacneil_gmail.com:*but...
(10:50:36 AM)*bonhagjeffrey:*I'm sure your opinions are valid
(10:51:09 AM)*omacneil_gmail.com:*ok not enough to have a final opinion that should pre-determine the decsion (10:51:42 AM)*omacneil_gmail.com:*my predjudices are against wrappers that trade one langauge syntax for another less well known one
(10:51:52 AM)*omacneil_gmail.com:*IMNSHO SQL is easier in SQL than perl
(10:52:04 AM)*bonhagjeffrey:*IMNSHO?
(10:52:13 AM)*emaadmanzoor_gmail.com:*Seriously Humble Opinion
(10:52:18 AM)*omacneil_gmail.com:*In My Not So Humble Opinion
(10:52:24 AM)*bonhagjeffrey:*gotcha
(10:52:35 AM)*emaadmanzoor_gmail.com:*Oh, ok.
(10:52:48 AM)*emaadmanzoor_gmail.com:*Missed the 'N'
(10:52:50 AM)*omacneil_gmail.com:*but I have never used anything like DBIx:::Class (10:53:21 AM)*bonhagjeffrey:*I mean, I guess if we can avoid adding another layer of abstraction, that's probably good (10:54:32 AM)*bonhagjeffrey:*What if all the SQL was stored in one location, and the config file told us which set of statements to use?
(10:54:38 AM)*bonhagjeffrey:*sql/SQLite
(10:54:42 AM)*bonhagjeffrey:*sql/Postgres
(10:54:43 AM)*bonhagjeffrey:*etc.
(10:54:55 AM)*omacneil_gmail.com:*sure, that might work well
(10:55:17 AM)*bonhagjeffrey:*is this kind of what SQL::Library is for?
(10:55:17 AM)*omacneil_gmail.com:*another of my predjices is to favor CPAN code over homebrew
(10:56:16 AM)*omacneil_gmail.com:*We went with SQL::Library to
(10:56:48 AM)*omacneil_gmail.com:*a. avoid duplicate / overlapping slighly reducndent SQL queries (10:57:08 AM)*omacneil_gmail.com:*a-1 pretty much the same reasoning for sub routines vs copy and paste (10:57:58 AM)*omacneil_gmail.com:*b. better MVC (model view controller) so (in theory) we could swtich the V from html to android or GTK or .... more easily (10:58:40 AM)*omacneil_gmail.com:*c. prep for database independence, all the SQL in one place would make it easier to factor out the SQL that ddidn't work with all flavors od SQL database (10:59:16 AM)*omacneil_gmail.com:*a nice side effect is that we can syntax check the SQL in the unit tests now (11:00:14 AM)*omacneil_gmail.com:*current project goal is to be able to use different databases esp SQLite to simplify package install (mostly) and to allow user their choice of db (11:00:52 AM)*omacneil_gmail.com:*if this can be done most easily by scrapping existing SQL::Library setup then that would be good
(11:01:06 AM)*omacneil_gmail.com:*if you look at ...
(11:01:55 AM)*omacneil_gmail.com:*lib-mvhub/lib/MVHub/CGIAppBase.pm
(11:02:19 AM)*omacneil_gmail.com:*MVHub::Utils::DB::get_dbh( $ENV{MV_CONFIG_FILE} ); (11:04:10 AM)*omacneil_gmail.com:*these are the only places that will have to be modified to give the user the right database handle and the right SQL statement
(11:04:24 AM)*omacneil_gmail.com:*( I think)
(11:04:37 AM)*bonhagjeffrey:*hang on
(11:04:37 AM)*omacneil_gmail.com:*DBIx ******MAY******
(11:04:45 AM)*omacneil_gmail.com:*require more modifcations
(11:04:47 AM)*omacneil_gmail.com:*hanging
(11:09:53 AM)*omacneil_gmail.com [/omacneil@xxxxxxxxx/TalkGadget952BDB0B/] entered the room.*
(11:09:54 AM)*emaadmanzoor_gmail.com entered the room.*
(11:09:54 AM)*roger.wieand_gmail.com [/roger.wieand@xxxxxxxxx/TalkGadget5B62A0EB/] entered the room.* (11:10:13 AM)*bonhagjeffrey:*Okay, sorry. I was with you up until ******* ******* (11:11:41 AM)*omacneil_gmail.com:*full remark was DBIx *****MAY***** require more modifications
(11:11:48 AM)*omacneil_gmail.com:*and then 'hanging'
(11:12:14 AM)*bonhagjeffrey:*You're probably right.
(11:12:16 AM)*omacneil_gmail.com:*I'm not seeing how to log the chat in this flash client...
(11:12:37 AM)*bonhagjeffrey:*oh, I am logging
(11:13:18 AM)*omacneil_gmail.com:*Well we should resevice judgement until you've looked at MVHub::CGIAppBase and MVHub::Wrap::DB (?)
(11:13:29 AM)*omacneil_gmail.com:*and I've looked at DBI::Schema
(11:13:39 AM)*omacneil_gmail.com:*oh good you are logging
(11:13:52 AM)*omacneil_gmail.com:*Are you on pdigin ?
(11:13:58 AM)*bonhagjeffrey:*yes
(11:14:12 AM)*emaadmanzoor_gmail.com:*It's getting saved into my Gmail chats
(11:14:20 AM)*omacneil_gmail.com:*ok so pidgin maybe can't initate group chat and gets booted but can log and copy 'n paste
(11:14:39 AM)*bonhagjeffrey:*with our powers combined...
(11:25:42 AM)*bonhagjeffrey:*does it make more sense to give each library entry a unique name, a la AGENCY_X_ALL_SQLITE, or keep the names identical across database servers? (11:26:52 AM)*omacneil_gmail.com:*if the names are identical across databases, then the code that calls the SQL::Library entries won't have to be modified
(11:27:18 AM)*bonhagjeffrey:*that's a plus
(11:28:04 AM)*omacneil_gmail.com:*if there is db specific SQL , the branching can be done in one place
(11:28:16 AM)*omacneil_gmail.com:*(two places actually)
(11:28:23 AM)*omacneil_gmail.com:*2 maybe
(11:28:59 AM)*omacneil_gmail.com:*a rough design might be to modify ...
(11:29:38 AM)*omacneil_gmail.com:*http://search.cpan.org/~frew/DBIx-Class-0.08192/lib/DBIx/Class.pm <http://search.cpan.org/%7Efrew/DBIx-Class-0.08192/lib/DBIx/Class.pm> (11:29:47 AM)*omacneil_gmail.com:*http://search.cpan.org/~frew/DBIx-Class-0.08192/lib/DBIx/Class.pm <http://search.cpan.org/%7Efrew/DBIx-Class-0.08192/lib/DBIx/Class.pm>
(11:29:56 AM)*omacneil_gmail.com:*sorry wrong paste
(11:30:33 AM)*omacneil_gmail.com:*modify lib-mvhub/lib/MVHub/Utils/DB.pm:: get_sql_* (11:30:53 AM)*omacneil_gmail.com:*to return the right SQL statement based on the current db in use (11:31:36 AM)*omacneil_gmail.com:*probably a dispatch table would be much better than a long if / elsif / elsif (11:34:00 AM)*bonhagjeffrey:*also cgiapp_init in lib-mvhub/lib/MVHub/CGIAppBase.pm ?
(11:34:35 AM)*bonhagjeffrey:*the $self->{_sql_*_lib} statements
(11:36:00 AM)*omacneil_gmail.com:*yes
(11:36:26 AM)*roger.wieand_gmail.com left the room.*
(11:36:42 AM)*omacneil_gmail.com:*Ferhat is working on moving everything to CGI::Application so eventually the direct MVHub::Utils::DB stuff will go away
(11:36:51 AM)*bonhagjeffrey:*oh, sweet
(11:38:22 AM)*bonhagjeffrey:*so I could rename sql_*.lib to sql_*_postgres.lib (11:38:23 AM)*omacneil_gmail.com:*another approach, perhaps slicker would be to in CGIAppBase::cgiapp_init()
(11:38:54 AM)*omacneil_gmail.com:*replace $self->{_sql_select_lib}
= new SQL::Library { lib => "$conf_dir/sql_select.lib" };

(11:39:23 AM)*bonhagjeffrey:*that's what I was looking at
(11:40:01 AM)*omacneil_gmail.com:*with code that
(11:40:26 AM)*omacneil_gmail.com:*created a SQL library object from the *all_database_seelects.sql'
(11:40:41 AM)*omacneil_gmail.com:*and then replaced the db specific
(11:41:02 AM)*omacneil_gmail.com:*sql with code from db specific library files (11:41:23 AM)*emaadmanzoor_gmail.com:*Hey Dan, may I grab some dinner? Sorry for this...
(11:41:59 AM)*omacneil_gmail.com:*absolutely
(11:42:06 AM)*omacneil_gmail.com:*maybe we should start earlier
(11:42:25 AM)*omacneil_gmail.com:*my wife will be happy to have me out of bed at a more reasonable hour (11:43:05 AM)*omacneil_gmail.com:*I have your merge request open now... when you return from dinner or perhaps when you wake up there will be feedback (11:43:20 AM)*omacneil_gmail.com:*Jeff should be able to post transcript to listserv (11:43:30 AM)*emaadmanzoor_gmail.com:*Oh thanks! I was planning to cancel it and send a bunch of smaller requests.
(11:43:37 AM)*bonhagjeffrey:*can do
(11:43:47 AM)*omacneil_gmail.com:*no, my lack of organization shuldn't make more work for you (11:44:25 AM)*emaadmanzoor_gmail.com:*Thanks Dan, I'll need to be added back to the group chat after dinner so I'll ping you or Jeff
(11:44:29 AM)*emaadmanzoor_gmail.com:*Bye
(11:45:12 AM)*omacneil_gmail.com:*ok
(11:45:38 AM)*omacneil_gmail.com:*on a meta note, it looks like registering a freenode IRC channel is pretty easy (11:46:22 AM)*omacneil_gmail.com:*I'd gotten that confused with registering an organization with freenode to make things official which I did a year ago and never got a response for
(11:46:33 AM)*omacneil_gmail.com:*IRC looks better than Flash gchat
(11:46:40 AM)*bonhagjeffrey:*you wanna migrate?
(11:47:09 AM)*omacneil_gmail.com:*not for this converation but perhaps for the next
(11:47:30 AM)*emaadmanzoor_gmail.com left the room.*
(11:48:53 AM)*bonhagjeffrey:*So I just send the log to mvhub-dev@xxxxxxxxxxxxxxxxxxx <mailto:mvhub-dev@xxxxxxxxxxxxxxxxxxx> ?
(11:49:32 AM)*omacneil_gmail.com:*yes
(11:50:15 AM)*omacneil_gmail.com:*looking at man SQL::Library
(11:50:20 AM)*omacneil_gmail.com:*it looks like you can
(11:50:39 AM)*omacneil_gmail.com:*1) create SQL object from 'all.sql'
(11:51:11 AM)*omacneil_gmail.com:*2) create SQL obejct from 'sqlite-or-oher.sql'
(11:51:35 AM)*omacneil_gmail.com:*3) get hash of querries from $other-sql
(11:52:17 AM)*omacneil_gmail.com:*iterate through the hash calling the set method on the $sql-all- object
(11:53:53 AM)*roger.wieand_gmail.com entered the room.*
(11:55:29 AM)*bonhagjeffrey:*I think this is a nice approach
(11:55:33 AM)*omacneil_gmail.com:*app-mvhub/t/sql_lib_sanity.t
(11:55:40 AM)*omacneil_gmail.com:*has much of the logic for looping
(11:57:05 AM)*roger.wieand_gmail.com left the room.*
(11:57:12 AM)*omacneil_gmail.com:*yeah I'm looking at DBx::Schema and it looks like using it will require replacing all our $dbh->selectall_arrayref() calls with DBx::Schema synatax
(11:57:21 AM)*bonhagjeffrey:*exactly
(12:00:22 PM)*roger.wieand_gmail.com entered the room.*
(12:00:52 PM)*omacneil_gmail.com:*so there are 2 or 3 bits to the abstraction database createion / schema modififcation + database access (12:01:51 PM)*omacneil_gmail.com:*plus maybe the sequences and stored procedures (12:02:16 PM)*omacneil_gmail.com:*I think the stored procedures are used only in 1-3 places
(12:02:26 PM)*omacneil_gmail.com:*grep -r is your friend
(12:03:04 PM)*omacneil_gmail.com:*it may be possible to use the same database creation stuff for all database / sql flavors (12:03:31 PM)*omacneil_gmail.com:*taking care ( as you have observed) to not use those fancy MODIFY TABLE statements that SQLITE doesn't support (12:05:05 PM)*bonhagjeffrey:*are the .sql files in /app-mvhub/setup/database/sql used for upgrading the software?
(12:05:34 PM)*omacneil_gmail.com:*yes
(12:05:49 PM)*omacneil_gmail.com:*there are approximately 4 bits to the software
(12:06:01 PM)*omacneil_gmail.com:*the stuff in version control
(12:06:12 PM)*omacneil_gmail.com:*see symlink link-to-live code
(12:06:15 PM)*omacneil_gmail.com:*the database
(12:06:24 PM)*omacneil_gmail.com:*(see database/sql)
(12:06:33 PM)*omacneil_gmail.com:*the directory structure
(12:06:47 PM)*omacneil_gmail.com:*(see /var/www/mvhub/$USER
(12:07:06 PM)*omacneil_gmail.com:*the conf files
(12:07:26 PM)*omacneil_gmail.com:*(see /var/www/mvhub/$USER/conf/*.conf)
(12:07:38 PM)*omacneil_gmail.com:*and also /etc/apache2/
(12:08:01 PM)*omacneil_gmail.com:*when you run mv_update_development ( or mv_update_production) (12:08:48 PM)*omacneil_gmail.com:*it takes the app-mvhub/setup/database/sql files and matches the nn in nn_filename.sql to the schema version number in the db
(12:09:23 PM)*bonhagjeffrey:*okay.
(12:09:31 PM)*omacneil_gmail.com:*if db schema number is 08 then 09_add_foo_table.sql is run (12:09:52 PM)*bonhagjeffrey:*so theoretically, we should be able to support someone who wants to migrate version 7 of the software on Postgres to version 8 of the software on SQLite?
(12:09:57 PM)*bonhagjeffrey:*or is that way jumping the gun?
(12:10:32 PM)*omacneil_gmail.com:*one difference between mv_update_development and mv_update_production is that the contents of the production database are not destroyed with app-mvhub/project-tools/conf/test_*_sql (12:11:41 PM)*omacneil_gmail.com:*the existing app-mvhub/setup/database stuff only handles schmea changes and meta data ( cities , headings, categories) changes (12:12:02 PM)*omacneil_gmail.com:*so there would be a bit more work dumping the actual data (12:12:38 PM)*omacneil_gmail.com:*so yes, easy migration from one to the other would be a seperate project (12:17:19 PM)*bonhagjeffrey:*Dan, do you mind if I hop off for a half hour and grab some lunch?
(12:17:55 PM)*omacneil_gmail.com:*absolutely not , go right ahead
(12:18:05 PM)*omacneil_gmail.com:*I think we were sorta at a stopping point
(12:18:19 PM)*omacneil_gmail.com:*feel free to ping me when you get back
(12:18:44 PM)*bonhagjeffrey:*thanks, will do
(12:22:40 PM)*roger.wieand_gmail.com left the room.*