当前位置: 首页>>代码示例>>C#>>正文


C# SQLiteConnection.RunQueries方法代码示例

本文整理汇总了C#中System.Data.SQLite.SQLiteConnection.RunQueries方法的典型用法代码示例。如果您正苦于以下问题:C# SQLiteConnection.RunQueries方法的具体用法?C# SQLiteConnection.RunQueries怎么用?C# SQLiteConnection.RunQueries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.SQLite.SQLiteConnection的用法示例。


在下文中一共展示了SQLiteConnection.RunQueries方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

        /// <summary>
        /// Opens the connection to the database
        /// </summary>
        /// <returns>Task.</returns>
        public async Task Initialize()
        {
            var dbFile = Path.Combine(_appPaths.DataPath, "chapters.db");

            _connection = await SqliteExtensions.ConnectToDb(dbFile).ConfigureAwait(false);

            string[] queries = {

                                "create table if not exists chapters (ItemId GUID, ChapterIndex INT, StartPositionTicks BIGINT, Name TEXT, ImagePath TEXT, PRIMARY KEY (ItemId, ChapterIndex))",
                                "create index if not exists idx_chapters on chapters(ItemId, ChapterIndex)",

                                //pragmas
                                "pragma temp_store = memory"
                               };

            _connection.RunQueries(queries, _logger);

            PrepareStatements();
        }
开发者ID:JasoonJ,项目名称:MediaBrowser,代码行数:23,代码来源:SqliteChapterRepository.cs

示例2: 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).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"
                               };

            _connection.RunQueries(queries, _logger);

            PrepareStatements();

            _chapterRepository.Initialize();
        }
开发者ID:0sm0,项目名称:MediaBrowser,代码行数:28,代码来源:SqliteItemRepository.cs

示例3: 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).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);
        }
开发者ID:JasoonJ,项目名称:MediaBrowser,代码行数:21,代码来源:SqliteUserRepository.cs

示例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).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"
                               };

            _connection.RunQueries(queries, _logger);
        }
开发者ID:0sm0,项目名称:MediaBrowser,代码行数:20,代码来源:SqliteDisplayPreferencesRepository.cs


注:本文中的System.Data.SQLite.SQLiteConnection.RunQueries方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。