Skip to content

Commit 4b89b31

Browse files
committed
Updated index.tsx code to pass the Database instance usewebsocket: true option for app to work on iOS
1 parent ecac28c commit 4b89b31

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

sqlite-cloud/quick-start-react-native.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ export default function App() {
4646

4747
useEffect(() => {
4848
async function getAlbums() {
49-
const db = new Database(
50-
'<your-connection-string>'
51-
);
49+
const db = new Database({
50+
connectionstring: '<your-connection-string>',
51+
usewebsocket: true,
52+
});
5253

5354
const result =
5455
await db.sql`USE DATABASE chinook.sqlite; SELECT albums.AlbumId as id, albums.Title as title, artists.name as artist FROM albums INNER JOIN artists WHERE artists.ArtistId = albums.ArtistId LIMIT 20;`;

0 commit comments

Comments
 (0)