toolkit/components/places/nsPlacesIndexes.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/places/nsPlacesIndexes.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,124 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 + * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef nsPlacesIndexes_h__
    1.11 +#define nsPlacesIndexes_h__
    1.12 +
    1.13 +#define CREATE_PLACES_IDX(__name, __table, __columns, __type) \
    1.14 +  NS_LITERAL_CSTRING( \
    1.15 +    "CREATE " __type " INDEX IF NOT EXISTS " __table "_" __name \
    1.16 +      " ON " __table " (" __columns ")" \
    1.17 +  )
    1.18 +
    1.19 +/**
    1.20 + * moz_places
    1.21 + */
    1.22 +#define CREATE_IDX_MOZ_PLACES_URL \
    1.23 +  CREATE_PLACES_IDX( \
    1.24 +    "url_uniqueindex", "moz_places", "url", "UNIQUE" \
    1.25 +  )
    1.26 +
    1.27 +#define CREATE_IDX_MOZ_PLACES_FAVICON \
    1.28 +  CREATE_PLACES_IDX( \
    1.29 +    "faviconindex", "moz_places", "favicon_id", "" \
    1.30 +  )
    1.31 +
    1.32 +#define CREATE_IDX_MOZ_PLACES_REVHOST \
    1.33 +  CREATE_PLACES_IDX( \
    1.34 +    "hostindex", "moz_places", "rev_host", "" \
    1.35 +  )
    1.36 +
    1.37 +#define CREATE_IDX_MOZ_PLACES_VISITCOUNT \
    1.38 +  CREATE_PLACES_IDX( \
    1.39 +    "visitcount", "moz_places", "visit_count", "" \
    1.40 +  )
    1.41 +
    1.42 +#define CREATE_IDX_MOZ_PLACES_FRECENCY \
    1.43 +  CREATE_PLACES_IDX( \
    1.44 +    "frecencyindex", "moz_places", "frecency", "" \
    1.45 +  )
    1.46 +
    1.47 +#define CREATE_IDX_MOZ_PLACES_LASTVISITDATE \
    1.48 +  CREATE_PLACES_IDX( \
    1.49 +    "lastvisitdateindex", "moz_places", "last_visit_date", "" \
    1.50 +  )
    1.51 +
    1.52 +#define CREATE_IDX_MOZ_PLACES_GUID \
    1.53 +  CREATE_PLACES_IDX( \
    1.54 +    "guid_uniqueindex", "moz_places", "guid", "UNIQUE" \
    1.55 +  )
    1.56 +
    1.57 +/**
    1.58 + * moz_historyvisits
    1.59 + */
    1.60 +
    1.61 +#define CREATE_IDX_MOZ_HISTORYVISITS_PLACEDATE \
    1.62 +  CREATE_PLACES_IDX( \
    1.63 +    "placedateindex", "moz_historyvisits", "place_id, visit_date", "" \
    1.64 +  )
    1.65 +
    1.66 +#define CREATE_IDX_MOZ_HISTORYVISITS_FROMVISIT \
    1.67 +  CREATE_PLACES_IDX( \
    1.68 +    "fromindex", "moz_historyvisits", "from_visit", "" \
    1.69 +  )
    1.70 +
    1.71 +#define CREATE_IDX_MOZ_HISTORYVISITS_VISITDATE \
    1.72 +  CREATE_PLACES_IDX( \
    1.73 +    "dateindex", "moz_historyvisits", "visit_date", "" \
    1.74 +  )
    1.75 +
    1.76 +/**
    1.77 + * moz_bookmarks
    1.78 + */
    1.79 +
    1.80 +#define CREATE_IDX_MOZ_BOOKMARKS_PLACETYPE \
    1.81 +  CREATE_PLACES_IDX( \
    1.82 +    "itemindex", "moz_bookmarks", "fk, type", "" \
    1.83 +  )
    1.84 +
    1.85 +#define CREATE_IDX_MOZ_BOOKMARKS_PARENTPOSITION \
    1.86 +  CREATE_PLACES_IDX( \
    1.87 +    "parentindex", "moz_bookmarks", "parent, position", "" \
    1.88 +  )
    1.89 +
    1.90 +#define CREATE_IDX_MOZ_BOOKMARKS_PLACELASTMODIFIED \
    1.91 +  CREATE_PLACES_IDX( \
    1.92 +    "itemlastmodifiedindex", "moz_bookmarks", "fk, lastModified", "" \
    1.93 +  )
    1.94 +
    1.95 +#define CREATE_IDX_MOZ_BOOKMARKS_GUID \
    1.96 +  CREATE_PLACES_IDX( \
    1.97 +    "guid_uniqueindex", "moz_bookmarks", "guid", "UNIQUE" \
    1.98 +  )
    1.99 +
   1.100 +/**
   1.101 + * moz_annos
   1.102 + */
   1.103 +
   1.104 +#define CREATE_IDX_MOZ_ANNOS_PLACEATTRIBUTE \
   1.105 +  CREATE_PLACES_IDX( \
   1.106 +    "placeattributeindex", "moz_annos", "place_id, anno_attribute_id", "UNIQUE" \
   1.107 +  )
   1.108 +
   1.109 +/**
   1.110 + * moz_items_annos
   1.111 + */
   1.112 +
   1.113 +#define CREATE_IDX_MOZ_ITEMSANNOS_PLACEATTRIBUTE \
   1.114 +  CREATE_PLACES_IDX( \
   1.115 +    "itemattributeindex", "moz_items_annos", "item_id, anno_attribute_id", "UNIQUE" \
   1.116 +  )
   1.117 +
   1.118 +/**
   1.119 + * moz_favicons
   1.120 + */
   1.121 +
   1.122 +#define CREATE_IDX_MOZ_FAVICONS_GUID \
   1.123 +  CREATE_PLACES_IDX( \
   1.124 +    "guid_uniqueindex", "moz_favicons", "guid", "UNIQUE" \
   1.125 +  )
   1.126 +
   1.127 +#endif // nsPlacesIndexes_h__

mercurial