本文整理汇总了C#中IDbConnection.RunQueries方法的典型用法代码示例。如果您正苦于以下问题:C# IDbConnection.RunQueries方法的具体用法?C# IDbConnection.RunQueries怎么用?C# IDbConnection.RunQueries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDbConnection
的用法示例。
在下文中一共展示了IDbConnection.RunQueries方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
/// <summary>
/// Opens the connection to the database
/// </summary>
/// <returns>Task.</returns>
public async Task Initialize()
{
var dbFile = Path.Combine(_appPaths.DataPath, "refreshinfo.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
string[] queries = {
"create table if not exists MetadataStatus (ItemId GUID PRIMARY KEY, ItemName TEXT, ItemType TEXT, SeriesName TEXT, DateLastMetadataRefresh datetime, DateLastImagesRefresh datetime, LastStatus TEXT, LastErrorMessage TEXT, MetadataProvidersRefreshed TEXT, ImageProvidersRefreshed TEXT, ItemDateModified DateTimeNull)",
"create index if not exists idx_MetadataStatus on MetadataStatus(ItemId)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, _logger);
AddItemDateModifiedCommand();
PrepareStatements();
_shrinkMemoryTimer = new SqliteShrinkMemoryTimer(_connection, _writeLock, _logger);
}
示例2: Initialize
/// <summary>
/// Opens the connection to the database
/// </summary>
/// <returns>Task.</returns>
public async Task Initialize()
{
var dbFile = Path.Combine(_appPaths.DataPath, "users.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
string[] queries = {
"create table if not exists users (guid GUID primary key, data BLOB)",
"create index if not exists idx_users on users(guid)",
"create table if not exists schema_version (table_name primary key, version)",
//pragmas
"pragma temp_store = memory"
};
_connection.RunQueries(queries, _logger);
}
示例3: Initialize
public async Task Initialize()
{
var dbFile = Path.Combine(_appPaths.DataPath, "notifications.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile).ConfigureAwait(false);
string[] queries = {
"create table if not exists Notifications (Id GUID NOT NULL, UserId GUID NOT NULL, Date DATETIME NOT NULL, Name TEXT NOT NULL, Description TEXT, Url TEXT, Level TEXT NOT NULL, IsRead BOOLEAN NOT NULL, Category TEXT NOT NULL, RelatedId TEXT, PRIMARY KEY (Id, UserId))",
"create index if not exists idx_Notifications on Notifications(Id, UserId)",
//pragmas
"pragma temp_store = memory"
};
_connection.RunQueries(queries, _logger);
PrepareStatements();
}
示例4: Initialize
/// <summary>
/// Opens the connection to the database
/// </summary>
/// <returns>Task.</returns>
public async Task Initialize()
{
var dbFile = Path.Combine(_appPaths.DataPath, "displaypreferences.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, Logger).ConfigureAwait(false);
string[] queries = {
"create table if not exists userdisplaypreferences (id GUID, userId GUID, client text, data BLOB)",
"create unique index if not exists userdisplaypreferencesindex on userdisplaypreferences (id, userId, client)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, Logger);
}
示例5: Initialize
/// <summary>
/// Opens the connection to the database
/// </summary>
/// <returns>Task.</returns>
public async Task Initialize()
{
var dbFile = Path.Combine(_appPaths.DataPath, "fileorganization.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, Logger).ConfigureAwait(false);
string[] queries = {
"create table if not exists FileOrganizerResults (ResultId GUID PRIMARY KEY, OriginalPath TEXT, TargetPath TEXT, FileLength INT, OrganizationDate datetime, Status TEXT, OrganizationType TEXT, StatusMessage TEXT, ExtractedName TEXT, ExtractedYear int null, ExtractedSeasonNumber int null, ExtractedEpisodeNumber int null, ExtractedEndingEpisodeNumber, DuplicatePaths TEXT int null)",
"create index if not exists idx_FileOrganizerResults on FileOrganizerResults(ResultId)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, Logger);
PrepareStatements();
}
示例6: Initialize
/// <summary>
/// Opens the connection to the database
/// </summary>
/// <returns>Task.</returns>
public async Task Initialize(IDbConnector dbConnector)
{
var dbFile = Path.Combine(_appPaths.DataPath, "shares.db");
_connection = await dbConnector.Connect(dbFile).ConfigureAwait(false);
string[] queries = {
"create table if not exists Shares (Id GUID, ItemId TEXT, UserId TEXT, ExpirationDate DateTime, PRIMARY KEY (Id))",
"create index if not exists idx_Shares on Shares(Id)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, Logger);
PrepareStatements();
}
示例7: Initialize
public async Task Initialize()
{
var dbFile = Path.Combine(_appPaths.DataPath, "authentication.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
string[] queries = {
"create table if not exists AccessTokens (Id GUID PRIMARY KEY, AccessToken TEXT NOT NULL, DeviceId TEXT, AppName TEXT, DeviceName TEXT, UserId TEXT, IsActive BIT, DateCreated DATETIME NOT NULL, DateRevoked DATETIME)",
"create index if not exists idx_AccessTokens on AccessTokens(Id)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, _logger);
PrepareStatements();
}
示例8: Initialize
/// <summary>
/// Opens the connection to the database
/// </summary>
/// <returns>Task.</returns>
public async Task Initialize()
{
var dbFile = Path.Combine(_appPaths.DataPath, "refreshinfo.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, Logger).ConfigureAwait(false);
string[] queries = {
"create table if not exists MetadataStatus (ItemId GUID PRIMARY KEY, DateLastMetadataRefresh datetime, DateLastImagesRefresh datetime, ItemDateModified DateTimeNull)",
"create index if not exists idx_MetadataStatus on MetadataStatus(ItemId)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, Logger);
AddItemDateModifiedCommand();
PrepareStatements();
}
示例9: Initialize
public async Task Initialize()
{
var dbFile = Path.Combine(_appPaths.DataPath, "sync.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
string[] queries = {
"create table if not exists SyncJobs (Id GUID PRIMARY KEY, TargetId TEXT NOT NULL, Name TEXT NOT NULL, Quality TEXT NOT NULL, Status TEXT NOT NULL, Progress FLOAT, UserId TEXT NOT NULL, ItemIds TEXT NOT NULL, UnwatchedOnly BIT, SyncLimit BigInt, LimitType TEXT, IsDynamic BIT, DateCreated DateTime, DateLastModified DateTime, ItemCount int)",
"create index if not exists idx_SyncJobs on SyncJobs(Id)",
"create table if not exists SyncJobItems (Id GUID PRIMARY KEY, ItemId TEXT, JobId TEXT, OutputPath TEXT, Status TEXT, TargetId TEXT)",
"create index if not exists idx_SyncJobItems on SyncJobs(Id)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, _logger);
PrepareStatements();
}
示例10: Initialize
/// <summary>
/// Opens the connection to the database
/// </summary>
/// <returns>Task.</returns>
public async Task Initialize(IDbConnector dbConnector)
{
var dbFile = Path.Combine(_appPaths.DataPath, "userdata_v2.db");
_connection = await dbConnector.Connect(dbFile).ConfigureAwait(false);
string[] queries = {
"create table if not exists userdata (key nvarchar, userId GUID, rating float null, played bit, playCount int, isFavorite bit, playbackPositionTicks bigint, lastPlayedDate datetime null)",
"create index if not exists idx_userdata on userdata(key)",
"create unique index if not exists userdataindex on userdata (key, userId)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, Logger);
_connection.AddColumn(Logger, "userdata", "AudioStreamIndex", "int");
_connection.AddColumn(Logger, "userdata", "SubtitleStreamIndex", "int");
}
示例11: Initialize
/// <summary>
/// Opens the connection to the database
/// </summary>
/// <returns>Task.</returns>
public async Task Initialize()
{
var dbFile = Path.Combine(_appPaths.DataPath, "library.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
string[] queries = {
"create table if not exists TypedBaseItems (guid GUID primary key, type TEXT, data BLOB)",
"create index if not exists idx_TypedBaseItems on TypedBaseItems(guid)",
"create table if not exists ChildrenIds (ParentId GUID, ItemId GUID, PRIMARY KEY (ParentId, ItemId))",
"create index if not exists idx_ChildrenIds on ChildrenIds(ParentId,ItemId)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, _logger);
PrepareStatements();
_mediaStreamsRepository.Initialize();
_providerInfoRepository.Initialize();
_chapterRepository.Initialize();
_shrinkMemoryTimer = new SqliteShrinkMemoryTimer(_connection, _writeLock, _logger);
}
示例12: Initialize
/// <summary>
/// Opens the connection to the database
/// </summary>
/// <returns>Task.</returns>
public async Task Initialize()
{
var dbFile = Path.Combine(_appPaths.DataPath, "library.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
var createMediaStreamsTableCommand
= "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, IsCabac BIT NULL, KeyFrames TEXT NULL, PRIMARY KEY (ItemId, StreamIndex))";
string[] queries = {
"create table if not exists TypedBaseItems (guid GUID primary key, type TEXT, data BLOB)",
"create index if not exists idx_TypedBaseItems on TypedBaseItems(guid)",
"create table if not exists ChildrenIds (ParentId GUID, ItemId GUID, PRIMARY KEY (ParentId, ItemId))",
"create index if not exists idx_ChildrenIds on ChildrenIds(ParentId,ItemId)",
"create table if not exists People (ItemId GUID, Name TEXT NOT NULL, Role TEXT, PersonType TEXT, SortOrder int, ListOrder int)",
"create table if not exists "+ChaptersTableName+" (ItemId GUID, ChapterIndex INT, StartPositionTicks BIGINT, Name TEXT, ImagePath TEXT, PRIMARY KEY (ItemId, ChapterIndex))",
"create index if not exists idx_"+ChaptersTableName+" on "+ChaptersTableName+"(ItemId, ChapterIndex)",
createMediaStreamsTableCommand,
"create index if not exists idx_mediastreams on mediastreams(ItemId, StreamIndex)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, _logger);
_connection.AddColumn(_logger, "TypedBaseItems", "Path", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "StartDate", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "EndDate", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "ChannelId", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IsMovie", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsSports", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsKids", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "CommunityRating", "Float");
_connection.AddColumn(_logger, "TypedBaseItems", "CustomRating", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IndexNumber", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsLocked", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "Name", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "OfficialRating", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "MediaType", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "Overview", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "ParentIndexNumber", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "PremiereDate", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "ProductionYear", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "ParentId", "GUID");
_connection.AddColumn(_logger, "TypedBaseItems", "Genres", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "ParentalRatingValue", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "SchemaVersion", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "SortName", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "RunTimeTicks", "BIGINT");
_connection.AddColumn(_logger, "TypedBaseItems", "OfficialRatingDescription", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "HomePageUrl", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "VoteCount", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "DisplayMediaType", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "DateCreated", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "DateModified", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "ForcedSortName", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IsOffline", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "LocationType", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IsSeries", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsLive", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsNews", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsPremiere", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "EpisodeTitle", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IsRepeat", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "PreferredMetadataLanguage", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "PreferredMetadataCountryCode", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IsHD", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "ExternalEtag", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "DateLastRefreshed", "DATETIME");
PrepareStatements();
new MediaStreamColumns(_connection, _logger).AddColumns();
var chapterDbFile = Path.Combine(_appPaths.DataPath, "chapters.db");
if (File.Exists(chapterDbFile))
{
MigrateChapters(chapterDbFile);
}
var mediaStreamsDbFile = Path.Combine(_appPaths.DataPath, "mediainfo.db");
if (File.Exists(mediaStreamsDbFile))
//.........这里部分代码省略.........
示例13: Initialize
/// <summary>
/// Opens the connection to the database
/// </summary>
/// <returns>Task.</returns>
public async Task Initialize()
{
var dbFile = Path.Combine(_appPaths.DataPath, "library.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
string[] queries = {
"create table if not exists TypedBaseItems (guid GUID primary key, type TEXT, data BLOB)",
"create index if not exists idx_TypedBaseItems on TypedBaseItems(guid)",
"create table if not exists ChildrenIds (ParentId GUID, ItemId GUID, PRIMARY KEY (ParentId, ItemId))",
"create index if not exists idx_ChildrenIds on ChildrenIds(ParentId,ItemId)",
"create table if not exists People (ItemId GUID, Name TEXT NOT NULL, Role TEXT, PersonType TEXT, SortOrder int, ListOrder int)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, _logger);
_connection.AddColumn(_logger, "TypedBaseItems", "Path", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "StartDate", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "EndDate", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "ChannelId", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IsMovie", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsSports", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsKids", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "CommunityRating", "Float");
_connection.AddColumn(_logger, "TypedBaseItems", "CustomRating", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IndexNumber", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsLocked", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "Name", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "OfficialRating", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "MediaType", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "Overview", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "ParentIndexNumber", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "PremiereDate", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "ProductionYear", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "ParentId", "GUID");
_connection.AddColumn(_logger, "TypedBaseItems", "Genres", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "ParentalRatingValue", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "SchemaVersion", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "SortName", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "RunTimeTicks", "BIGINT");
_connection.AddColumn(_logger, "TypedBaseItems", "OfficialRatingDescription", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "HomePageUrl", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "VoteCount", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "DisplayMediaType", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "DateCreated", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "DateModified", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "ForcedSortName", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IsOffline", "BIT");
PrepareStatements();
_mediaStreamsRepository.Initialize();
_chapterRepository.Initialize();
}
示例14: Initialize
/// <summary>
/// Opens the connection to the database
/// </summary>
/// <returns>Task.</returns>
public async Task Initialize(IDbConnector dbConnector)
{
var dbFile = Path.Combine(_config.ApplicationPaths.DataPath, "library.db");
_connection = await dbConnector.Connect(dbFile).ConfigureAwait(false);
var createMediaStreamsTableCommand
= "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, PRIMARY KEY (ItemId, StreamIndex))";
string[] queries = {
"create table if not exists TypedBaseItems (guid GUID primary key, type TEXT, data BLOB, ParentId GUID, Path TEXT)",
"create index if not exists idx_TypedBaseItems on TypedBaseItems(guid)",
"create index if not exists idx_PathTypedBaseItems on TypedBaseItems(Path)",
"create index if not exists idx_ParentIdTypedBaseItems on TypedBaseItems(ParentId)",
"create table if not exists AncestorIds (ItemId GUID, AncestorId GUID, AncestorIdText TEXT, PRIMARY KEY (ItemId, AncestorId))",
"create index if not exists idx_AncestorIds1 on AncestorIds(AncestorId)",
"create index if not exists idx_AncestorIds2 on AncestorIds(AncestorIdText)",
"create table if not exists UserDataKeys (ItemId GUID, UserDataKey TEXT, PRIMARY KEY (ItemId, UserDataKey))",
"create index if not exists idx_UserDataKeys1 on UserDataKeys(ItemId)",
"create table if not exists People (ItemId GUID, Name TEXT NOT NULL, Role TEXT, PersonType TEXT, SortOrder int, ListOrder int)",
"create index if not exists idxPeopleItemId on People(ItemId)",
"create index if not exists idxPeopleName on People(Name)",
"create table if not exists "+ChaptersTableName+" (ItemId GUID, ChapterIndex INT, StartPositionTicks BIGINT, Name TEXT, ImagePath TEXT, PRIMARY KEY (ItemId, ChapterIndex))",
"create index if not exists idx_"+ChaptersTableName+"1 on "+ChaptersTableName+"(ItemId)",
createMediaStreamsTableCommand,
"create index if not exists idx_mediastreams1 on mediastreams(ItemId)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, Logger);
_connection.AddColumn(Logger, "AncestorIds", "AncestorIdText", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "Path", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "StartDate", "DATETIME");
_connection.AddColumn(Logger, "TypedBaseItems", "EndDate", "DATETIME");
_connection.AddColumn(Logger, "TypedBaseItems", "ChannelId", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "IsMovie", "BIT");
_connection.AddColumn(Logger, "TypedBaseItems", "IsSports", "BIT");
_connection.AddColumn(Logger, "TypedBaseItems", "IsKids", "BIT");
_connection.AddColumn(Logger, "TypedBaseItems", "CommunityRating", "Float");
_connection.AddColumn(Logger, "TypedBaseItems", "CustomRating", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "IndexNumber", "INT");
_connection.AddColumn(Logger, "TypedBaseItems", "IsLocked", "BIT");
_connection.AddColumn(Logger, "TypedBaseItems", "Name", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "OfficialRating", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "MediaType", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "Overview", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "ParentIndexNumber", "INT");
_connection.AddColumn(Logger, "TypedBaseItems", "PremiereDate", "DATETIME");
_connection.AddColumn(Logger, "TypedBaseItems", "ProductionYear", "INT");
_connection.AddColumn(Logger, "TypedBaseItems", "ParentId", "GUID");
_connection.AddColumn(Logger, "TypedBaseItems", "Genres", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "ParentalRatingValue", "INT");
_connection.AddColumn(Logger, "TypedBaseItems", "SchemaVersion", "INT");
_connection.AddColumn(Logger, "TypedBaseItems", "SortName", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "RunTimeTicks", "BIGINT");
_connection.AddColumn(Logger, "TypedBaseItems", "OfficialRatingDescription", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "HomePageUrl", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "VoteCount", "INT");
_connection.AddColumn(Logger, "TypedBaseItems", "DisplayMediaType", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "DateCreated", "DATETIME");
_connection.AddColumn(Logger, "TypedBaseItems", "DateModified", "DATETIME");
_connection.AddColumn(Logger, "TypedBaseItems", "ForcedSortName", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "IsOffline", "BIT");
_connection.AddColumn(Logger, "TypedBaseItems", "LocationType", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "IsSeries", "BIT");
_connection.AddColumn(Logger, "TypedBaseItems", "IsLive", "BIT");
_connection.AddColumn(Logger, "TypedBaseItems", "IsNews", "BIT");
_connection.AddColumn(Logger, "TypedBaseItems", "IsPremiere", "BIT");
_connection.AddColumn(Logger, "TypedBaseItems", "EpisodeTitle", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "IsRepeat", "BIT");
_connection.AddColumn(Logger, "TypedBaseItems", "PreferredMetadataLanguage", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "PreferredMetadataCountryCode", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "IsHD", "BIT");
_connection.AddColumn(Logger, "TypedBaseItems", "ExternalEtag", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "DateLastRefreshed", "DATETIME");
_connection.AddColumn(Logger, "TypedBaseItems", "DateLastSaved", "DATETIME");
_connection.AddColumn(Logger, "TypedBaseItems", "IsInMixedFolder", "BIT");
//.........这里部分代码省略.........
示例15: Initialize
/// <summary>
/// Opens the connection to the database
/// </summary>
/// <returns>Task.</returns>
public async Task Initialize()
{
var dbFile = Path.Combine(_appPaths.DataPath, "library.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
string[] queries = {
"create table if not exists TypedBaseItems (guid GUID primary key, type TEXT, data BLOB)",
"create index if not exists idx_TypedBaseItems on TypedBaseItems(guid)",
"create table if not exists ChildrenIds (ParentId GUID, ItemId GUID, PRIMARY KEY (ParentId, ItemId))",
"create index if not exists idx_ChildrenIds on ChildrenIds(ParentId,ItemId)",
//pragmas
"pragma temp_store = memory",
"pragma shrink_memory"
};
_connection.RunQueries(queries, _logger);
_connection.AddColumn(_logger, "TypedBaseItems", "Path", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "StartDate", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "EndDate", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "ChannelId", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IsMovie", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsSports", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsKids", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "CommunityRating", "Float");
_connection.AddColumn(_logger, "TypedBaseItems", "CustomRating", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IndexNumber", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsLocked", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "Name", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "OfficialRating", "Text");
PrepareStatements();
_mediaStreamsRepository.Initialize();
_chapterRepository.Initialize();
}