22 * Magic Cloud, copyright (c) 2023 Thomas Hansen.
33 * See the attached LICENSE file for details. For license inquiries email thomas@ainiro.io
44 */
5-
65using System ;
76using System . Threading . Tasks ;
87using System . Runtime . InteropServices ;
@@ -24,7 +23,7 @@ internal class SQLiteInitializer : IInitializer
2423
2524 public async Task Initialize ( IRootResolver resolver , SqliteConnection connection )
2625 {
27- connection . Open ( ) ;
26+ await connection . OpenAsync ( ) ;
2827 connection . EnableExtensions ( ) ;
2928
3029 var plt = GetPlatformExtension ( ) ;
@@ -39,7 +38,7 @@ public async Task Initialize(IRootResolver resolver, SqliteConnection connection
3938 {
4039 load . CommandText = "select load_extension($p, 'sqlite3_vector_init')" ;
4140 load . Parameters . AddWithValue ( "$p" , extensionPath ) ;
42- load . ExecuteScalar ( ) ;
41+ await load . ExecuteScalarAsync ( ) ;
4342 }
4443 break ;
4544 }
@@ -52,11 +51,11 @@ public async Task Initialize(IRootResolver resolver, SqliteConnection connection
5251
5352 using ( var cmd = connection . CreateCommand ( ) )
5453 {
55- cmd . CommandText = "select vector_init($tbl, $col, $opts);" ;
56- cmd . Parameters . AddWithValue ( "$tbl" , TableName ) ;
57- cmd . Parameters . AddWithValue ( "$col" , ColumnName ) ;
58- cmd . Parameters . AddWithValue ( "$opts" , Options ) ;
59- cmd . ExecuteScalar ( ) ;
54+ cmd . CommandText = "select vector_init($tbl, $col, $opts);" ;
55+ cmd . Parameters . AddWithValue ( "$tbl" , TableName ) ;
56+ cmd . Parameters . AddWithValue ( "$col" , ColumnName ) ;
57+ cmd . Parameters . AddWithValue ( "$opts" , Options ) ;
58+ await cmd . ExecuteScalarAsync ( ) ;
6059 }
6160 }
6261
0 commit comments