# \[Module:SQLiteSupport\] What is the path for a .db file?

**URL:** <https://forums.unrealengine.com/t/module-sqlitesupport-what-is-the-path-for-a-db-file/340261>\
**Category:** Mobile\
**Tags:** unreal-engine, iOS, UE4, CPP, question\
**Created:** [December 2, 2015, 12:30am UTC](https://forums.unrealengine.com/t/module-sqlitesupport-what-is-the-path-for-a-db-file/340261 "2015-12-02T00:30:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_1802266b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1802266b](https://forums.unrealengine.com/u/anonymous_user_1802266b)\
**Post date:** [December 2, 2015, 12:30am UTC](https://forums.unrealengine.com/t/module-sqlitesupport-what-is-the-path-for-a-db-file/340261/1 "2015-12-02T00:30:39Z")

</div>

I have the SQLiteSupport Module compiled and packaged for IOS.

The SQLite function for opening .db files is :

```
sqlite3_open(
  const char *filename, /* Database filename (UTF-8) */
  sqlite3 **ppDb /* OUT: SQLite db handle */
);

```

and my code is:

```
sqlite3* db;
FString DatabaseFilename = FPaths::GameContentDir() + "Game/GameData.db";
sqlite3_open(TCHAR_TO_UTF8(*DatabaseFilename));

```

The path works on Mac and PC, but not iOS. I’ve used relative and absolute paths and nothing works.  
Is there an example of this module working on iOS?

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [December 2, 2015, 12:53am UTC](https://forums.unrealengine.com/t/module-sqlitesupport-what-is-the-path-for-a-db-file/340261/2 "2015-12-02T00:53:58Z")

</div>

I would check paths if they are correct also logs may hint something (don’t know how to read logs from iOS, they probably apper in main log of device like in Android)

If you find need to make iOS specific code you can do this:

```
#if PLATFORM_IOS

//iOS code

#else

//For other platfroms

#endif

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1802266b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1802266b](https://forums.unrealengine.com/u/anonymous_user_1802266b)\
**Post date:** [December 2, 2015, 1:07am UTC](https://forums.unrealengine.com/t/module-sqlitesupport-what-is-the-path-for-a-db-file/340261/3 "2015-12-02T01:07:19Z")

</div>

The path is correct, as it works in Mac and PC. The log only provides what SQLite reports, which is that the .db file can not be accessed.

I’ve already tried platform specific code, specifically the function FIOSPlatformFile::ConvertToIOSPath, which does provide a full iOS path, but SQLite is still not able to access it.

I’ve confirmed that the file does in fact exist using FPaths::FileExists, but none of the following path related function have any success either:

```
FPaths::ConvertRelativePathToFull
FPlatformFileManager::Get().GetPlatformFile().ConvertToAbsolutePathForExternalAppForRead
FPlatformFileManager::Get().GetPlatformFile().ConvertToAbsolutePathForExternalAppForWrite

```

---

<div class="post-metadata">

**Author:** ![YeHaike](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YeHaike](https://forums.unrealengine.com/u/YeHaike)\
**Post date:** [July 20, 2017, 1:41am UTC](https://forums.unrealengine.com/t/module-sqlitesupport-what-is-the-path-for-a-db-file/340261/4 "2017-07-20T01:41:41Z")

</div>

> **[Using SQLite with Unreal (on iOS)](https://www.casualdistractiongames.com/post/2016/06/03/Using-SQLite-with-Unreal-on-iOS)**
>
> This post documents the steps needed to use sqlite within a UE4 game on ios. SQLite SQLite is awesome. It is a lightweight, self-contained database engine. It is often embedded in mobile apps because of its small footprint. For example, it is the...

---

<div class="post-metadata">

**Author:** ![YeHaike](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YeHaike](https://forums.unrealengine.com/u/YeHaike)\
**Post date:** [April 27, 2018, 1:55am UTC](https://forums.unrealengine.com/t/module-sqlitesupport-what-is-the-path-for-a-db-file/340261/5 "2018-04-27T01:55:09Z")

</div>

Hope this plugin can help you.

[HiSQLite3( SQLite3 For UE4)](https://www.unrealengine.com/marketplace/hisqlite3-sqlite3-for-ue4)
