30 references to Database
Microsoft.CodeAnalysis.Workspaces (30)
Storage\SQLite\v2\Database.cs (3)
59public static string GetName(this Database database) 62Database.Main => "main", 63Database.WriteCache => "writecache",
Storage\SQLite\v2\Interop\SqlConnection.cs (9)
38private static readonly byte[] s_mainNameWithTrailingZero = GetUtf8BytesWithTrailingZero(Database.Main.GetName()); 39private static readonly byte[] s_writeCacheNameWithTrailingZero = GetUtf8BytesWithTrailingZero(Database.WriteCache.GetName()); 137? $"attach database '{new Uri(databasePath.Replace("'", "''")).AbsoluteUri}?mode=memory&cache=shared' as {Database.WriteCache.GetName()};" 138: $"attach database 'file::memory:?cache=shared' as {Database.WriteCache.GetName()};"; 294public Optional<Stream> ReadDataBlob_MustRunInTransaction(Database database, Table table, long rowId) 302public Optional<Checksum> ReadChecksum_MustRunInTransaction(Database database, Table table, long rowId) 360Database database, Table table, Column column, long rowId, 379Database.Main => s_mainNameWithTrailingZero, 380Database.WriteCache => s_writeCacheNameWithTrailingZero,
Storage\SQLite\v2\SQLitePersistentStorage.Accessor.cs (15)
61var writeCache = Database.WriteCache.GetName(); 65$"insert or replace into {Database.Main.GetName()}.{TableName} select * from {writeCache}.{TableName};"; 67_select_rowid_from_main_table_where_0primarykey = GetSelectRowIdQuery(Database.Main); 68_select_rowid_from_writecache_table_where_0primarykey = GetSelectRowIdQuery(Database.WriteCache); 77string GetSelectRowIdQuery(Database database) 108public void CreateTable(SqlConnection connection, Database database) 159Func<TData, SqlConnection, Database, long, Optional<T>> readColumn, 187var optional = ReadColumnHelper(connection, Database.WriteCache, databaseKey, dataNameId); 191optional = ReadColumnHelper(connection, Database.Main, databaseKey, dataNameId); 204Optional<T> ReadColumnHelper(SqlConnection connection, Database database, TDatabaseKey databaseKey, int dataNameID) 263SqlConnection connection, Database database, long rowId, Checksum? checksum) 296SqlConnection connection, Database database, long rowId) 312private bool ChecksumsMatch_MustRunInTransaction(SqlConnection connection, Database database, long rowId, Checksum checksum) 327private bool TryGetActualRowIdFromDatabase(SqlConnection connection, Database database, TDatabaseKey databaseKey, int dataNameId, out long rowId) 337using var resettableStatement = connection.GetResettableStatement(database == Database.WriteCache
Storage\SQLite\v2\SQLitePersistentStorage.cs (3)
221EnsureTables(connection, Database.Main); 222EnsureTables(connection, Database.WriteCache); 232void EnsureTables(SqlConnection connection, Database database)