| 144 | |
| 145 | |
| 146 | StoragePtr DatabaseSQLite::fetchTable(const String & table_name, ContextPtr local_context, bool table_checked) const |
| 147 | { |
| 148 | if (!sqlite_db) |
| 149 | sqlite_db = openSQLiteDB(database_path, getContext(), /* throw_on_error */true); |
| 150 | |
| 151 | if (!table_checked && !checkSQLiteTable(table_name)) |
| 152 | return StoragePtr{}; |
| 153 | |
| 154 | auto columns = fetchSQLiteTableStructure(sqlite_db.get(), table_name); |
| 155 | |
| 156 | if (!columns) |
| 157 | return StoragePtr{}; |
| 158 | |
| 159 | auto storage = std::make_shared<StorageSQLite>( |
| 160 | StorageID(database_name, table_name), |
| 161 | sqlite_db, |
| 162 | database_path, |
| 163 | table_name, |
| 164 | ColumnsDescription{*columns}, |
| 165 | ConstraintsDescription{}, |
| 166 | /* comment = */ "", |
| 167 | local_context); |
| 168 | |
| 169 | return storage; |
| 170 | } |
| 171 | |
| 172 | |
| 173 | ASTPtr DatabaseSQLite::getCreateDatabaseQueryImpl() const |
nothing calls this directly
no test coverage detected