@@ -146,7 +146,10 @@ export async function ensureDatabaseExists(
146146throw new Error ( `${ code } :${ message } ` )
147147}
148148
149- if ( await createDatabase ( url , pathResolutionRoot ) ) {
149+ // For SQLite, we want to make sure we don't create a file with the query string in the name
150+ const urlToCreate = provider === 'sqlite' ?url . split ( '?' ) [ 0 ] :url
151+
152+ if ( await createDatabase ( urlToCreate , pathResolutionRoot ) ) {
150153// URI parsing is not implemented for SQL server yet
151154if ( provider === 'sqlserver' ) {
152155return `SQL Server database created.\n`
@@ -171,7 +174,7 @@ export async function ensureDatabaseExists(
171174// returns the "host" like localhost / 127.0.0.1 + default port
172175export function getDbLocation ( credentials :DatabaseCredentials ) :string | undefined {
173176if ( credentials . type === 'sqlite' ) {
174- return credentials . uri !
177+ return credentials . uri ! . split ( '?' ) [ 0 ]
175178}
176179
177180const socket = getSocketFromDatabaseCredentials ( credentials )
@@ -210,4 +213,6 @@ export function prettifyProvider(provider: ConnectorType): PrettyProvider {
210213case 'mongodb' :
211214return `MongoDB`
212215}
216+ // Fallback for any other provider type to satisfy TypeScript
217+ return provider as PrettyProvider
213218}