trustmaster / trac2github

Converts Trac milestones, tickets and comments into Github issues 2.0 using github api v3
49 stars 38 forks source link

Postgresql Support #9

Closed jlbooker closed 10 years ago

jlbooker commented 10 years ago

Postgresql is also a popular Trac backend. Connecting to a Postgresql database is easy with PDO, but there are several SQL syntax incompatibilities.

Update connection info to support connecting to Postgres and correct SQL syntax for compatibility.

ctrueden commented 10 years ago

@jlbooker: I like the way you implemented the PDO driver switch. Much more elegant and extensible than my SQLite file existence test hack. :+1:

jlbooker commented 10 years ago

@ctrueden Thanks! Your solution was fine when there are only two options, but I saw the if/elseif/else structure quickly getting out of hand for 3+ driver options.

I did keep the SQLite file existence check, though, since it's a nice sanity check. If we can give a more useful error message and help out the user, then we should. :+1: