]>
gitweb.michael.orlitzky.com - mailshears.git/blob - lib/rm/plugins/davical.rb
86273cba6e5d2a31f0fb617b24a88f9088d523cc
3 require 'common/davical_plugin'
8 # DAViCal only supports Postgres, so even if we ever are
9 # database-agnostic, this plugin can't be.
15 def delete_domain(domain
)
16 # DAViCal doesn't have a concept of domains.
20 def delete_account(account
)
21 # Delete the given username. DAViCal uses foreign keys properly
22 # and only supports postgres, so we let the ON DELETE CASCADE
23 # trigger handle most of the work.
24 sql_queries
= ['DELETE FROM usr WHERE username = $1']
27 connection
= PGconn
.connect(@db_host,
35 sql_queries
.each
do |sql_query
|
36 connection
.query(sql_query
, [account
])
42 # Pretend like we're database-agnostic in case we ever are.
43 raise DatabaseError
.new(e
)