- def describe_user(user)
- if self.user_exists(user)
- return "Username: #{user}"
- else
- return 'User not found'
+ # There are also "owner" and "with" fields in the "shares" table,
+ # but they contains principal URLs and not a bare username. Thus
+ # their format depends on the CalDAV server configuration, and
+ # isn't predictable.
+ sql_query = 'SELECT username FROM prefs;'
+
+ begin
+ connection.sync_exec(sql_query) do |result|
+ users = result.field_values('username')
+ end
+ ensure
+ # Make sure the connection gets closed even if the query explodes.
+ connection.close()