Skip to content

Commit 2d886ed

Browse files
committed
Use Application.persistentDataPath on SQLiteREPL if DbName is not absolute
1 parent 6e9a7dc commit 2d886ed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Samples~/REPL/SQLiteREPL.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* SOFTWARE.
2121
*/
2222
using System;
23+
using System.IO;
2324
using System.Text;
2425
using SQLite;
2526
using UnityEngine;
@@ -36,7 +37,8 @@ public class SQLiteREPL : MonoBehaviour
3637

3738
void Start()
3839
{
39-
_connection = new SQLiteConnection(DbName);
40+
string path = Path.IsPathRooted(DbName) ? DbName : Path.Join(Application.persistentDataPath, DbName);
41+
_connection = new SQLiteConnection(path);
4042
}
4143

4244
void OnDestroy()

0 commit comments

Comments
 (0)