#
# PUT a VCARD record into an addressbook
#
TYPE=PUT
URL=http://regression.host/caldav.php/user1/addressbook/PHRsMa4mvY.vcf

HEADER=Content-Type: text/vcard
HEAD

BEGINDATA
BEGIN:VCARD
CLASS:PUBLIC
EMAIL:zzz@xxx.ru
FN:zzz
N:zzz;;;;
NAME:zzz
REV:2010-11-18T14:27:41
UID:PHRsMa4mvY
VERSION:3.0
END:VCARD
ENDDATA

QUERY
SELECT caldav_data.dav_name, caldav_data.dav_etag,
       version, uid, nickname, fn, n, note, org, url, fburl, caladruri, caluri
  FROM caldav_data LEFT JOIN addressbook_resource USING(dav_id)
  WHERE caldav_data.dav_name ~ '/user1/addressbook/PHRsMa4mvY.vcf'
ENDQUERY

QUERY
SELECT 
       type, box_no, unit_no, street_address, locality, region, postcode, country, property
  FROM caldav_data 
        LEFT JOIN addressbook_address_adr USING(dav_id)
  WHERE caldav_data.dav_name ~ '/user1/addressbook/PHRsMa4mvY.vcf'
  ORDER BY dav_id, property
ENDQUERY

QUERY
SELECT 
        addressbook_address_tel.type, addressbook_address_tel.tel
  FROM caldav_data
        LEFT JOIN addressbook_address_tel USING(dav_id)
  WHERE caldav_data.dav_name ~ '/user1/addressbook/PHRsMa4mvY.vcf'
  ORDER BY dav_id, property
ENDQUERY

QUERY
SELECT 
        addressbook_address_email.type, addressbook_address_email.email
  FROM caldav_data
        LEFT JOIN addressbook_address_email USING(dav_id)
  WHERE caldav_data.dav_name ~ '/user1/addressbook/PHRsMa4mvY.vcf'
  ORDER BY dav_id, property
ENDQUERY


