38 return NS_ConvertASCIItoUTF16(aProperty.
mColumn);
46 nsString
Concat(nsAString
const &
aLeft, nsAString
const & aRight)
57 NS_NAMED_LITERAL_STRING(COMMA,
",");
59 for (PRUint32 property = 0;
property < NS_ARRAY_LENGTH(
sStaticProperties); ++property) {
68 nsString sbLocalDatabaseSQL::MediaItemColumns(PRBool aIncludeMediaItem)
70 if (mMediaItemColumns.IsEmpty()) {
73 if (mMediaItemColumnsWithID.IsEmpty()) {
74 mMediaItemColumnsWithID =
Concat(NS_LITERAL_STRING(
"media_item_id, "),
77 return aIncludeMediaItem ? mMediaItemColumnsWithID : mMediaItemColumns;
83 NS_LITERAL_STRING(
"SELECT media_item_id, property_id, obj \
84 FROM resource_properties \
85 WHERE media_item_id IN (");
87 sql.AppendLiteral(
"?, ");
89 sql.AppendLiteral(
"?)");
96 nsString sql = NS_LITERAL_STRING(
"DELETE FROM resource_properties_fts_all \
103 nsString result(NS_LITERAL_STRING(
"SELECT "));
104 result.Append(MediaItemColumns(PR_TRUE));
105 result.AppendLiteral(
" FROM media_items WHERE guid IN (");
107 result.AppendLiteral(
"?, ");
109 result.AppendLiteral(
"?)");
117 NS_LITERAL_STRING(
"INSERT INTO resource_properties_fts_all \
118 (rowid, alldata) VALUES (?, ?)");
124 return NS_LITERAL_STRING(
"SELECT property_id, obj \
125 FROM resource_properties \
126 WHERE media_item_id = 0");
131 if (mLibraryMediaItemSelect.IsEmpty()) {
132 mLibraryMediaItemSelect.AppendLiteral(
"SELECT ");
133 mLibraryMediaItemSelect.Append(MediaItemColumns(PR_FALSE));
134 mLibraryMediaItemSelect.AppendLiteral(
" FROM library_media_item");
136 return mLibraryMediaItemSelect;
141 return NS_LITERAL_STRING(
"INSERT INTO properties \
148 return NS_LITERAL_STRING(
"SELECT property_id, property_name \
154 return NS_LITERAL_STRING(
"INSERT OR REPLACE INTO resource_properties \
155 (media_item_id, property_id, obj, obj_searchable, obj_sortable, obj_secondary_sortable) \
156 VALUES (?, ?, ?, ?, ?, ?)");
162 return NS_LITERAL_STRING(
"DELETE FROM resource_properties WHERE media_item_id = ? AND property_id = ? ");
static const int MediaItemBindCount
static nsString PropertiesDelete()
static nsString MediaItemsFtsAllDelete()
static nsString MediaItemsFtsAllInsert()
static nsString PropertiesTableInsert()
static const int SecondaryPropertyBindCount
static nsString PropertiesInsert()
nsString Concat(nsAString const &aLeft, nsAString const &aRight)
static nsString sbStaticPropertyColumns()
static nsString LibraryMediaItemsPropertiesSelect()
static nsString PropertiesSelect()
nsString LibraryMediaItemSelect()
nsString MediaItemSelect()
static nsString SecondaryPropertySelect()
static sbStaticProperty sStaticProperties[]
_getSelectedPageStyle s i
nsString ExtractColumnFromProperty(sbStaticProperty const &aProperty)