Stop pretending that we'll ever work with another DBMS.
[mailshears.git] / lib / common / agendav_plugin.rb
index 032d057c24d8e25c899ea672ae5fca50a711a8ff..9af7b01519b40aca2870176948ed4f0ac6f950cb 100644 (file)
@@ -25,30 +25,19 @@ module AgendavPlugin
     #
     users = []
 
-    # Just assume PostgreSQL for now.
-    begin
-      connection = PGconn.connect(@db_host,
-                                  @db_port,
-                                  @db_opts,
-                                  @db_tty,
-                                  @db_name,
-                                  @db_user,
-                                  @db_pass)
-
-      sql_query  = '(SELECT username FROM prefs)'
-      sql_query += 'UNION'
-      sql_query += '(SELECT user_from FROM shared);'
-
-      connection.query(sql_query) do |result|
-        users = result.field_values('username')
-      end
-
-      connection.close()
-    rescue PGError => e
-      # Pretend like we're database-agnostic in case we ever are.
-      raise DatabaseError.new(e)
+    connection = PGconn.connect(@db_host, @db_port, @db_opts, @db_tty,
+                                @db_name, @db_user, @db_pass)
+
+    sql_query  = '(SELECT username FROM prefs)'
+    sql_query += 'UNION'
+    sql_query += '(SELECT user_from FROM shared);'
+
+    connection.query(sql_query) do |result|
+      users = result.field_values('username')
     end
 
+    connection.close()
+
     return users.map{ |u| User.new(u) }
   end