File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -723,8 +723,18 @@ async fn test_routing_with_db_fs_and_prefix() {
723723 . await
724724 . unwrap ( ) ;
725725
726- // Insert test file into database
727- sqlx:: query ( "INSERT INTO sqlpage_files(path, contents) VALUES ('tests/sql_test_files/it_works_simple.sql', 'SELECT ''It works !'' as message;')" )
726+ // Insert test file into database using database-specific syntax
727+ let db_kind = state. db . connection . any_kind ( ) ;
728+ let insert_sql = match db_kind {
729+ sqlx:: any:: AnyKind :: Mssql => {
730+ "INSERT INTO sqlpage_files(path, contents) VALUES (?, CONVERT(VARBINARY(MAX), ?))"
731+ }
732+ _ => "INSERT INTO sqlpage_files(path, contents) VALUES (?, ?)" ,
733+ } ;
734+
735+ sqlx:: query ( insert_sql)
736+ . bind ( "tests/sql_test_files/it_works_simple.sql" )
737+ . bind ( "SELECT 'It works !' as message;" )
728738 . execute ( & state. db . connection )
729739 . await
730740 . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments