You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Replace the code in `app/Http/Controllers/AlbumController.php` with the following snippet.
89
-
- In your SQLite Cloud account dashboard, click on a Node, copy the Connection String, and replace `<your-connection-string>` below.
89
+
- In your SQLite Cloud account dashboard, click on `Show connection strings`, copy the Connection String, and replace `<your-connection-string>` below.
90
90
- The `index` method will:
91
91
- connect to and query the database,
92
92
- create an array of arrays `albums` containing each returned album's title and artist,
This powerful package provides methods that simplify performing database operations in PHP applications, making it easier than ever to work with SQLite in the cloud. We encourage all users to log encountered issues in the [SDK’s issues backlog](https://github.com/sqlitecloud/sqlitecloud-php/issues).
14
10
15
11
## Install
16
12
13
+
- Run the following command to initialize a PHP project and install the SDK.
14
+
17
15
```bash
18
16
$ composer require sqlitecloud/sqlitecloud
19
17
```
20
18
21
-
SQLite Cloud is a powerful PHP package that allows you to interact with the SQLite Cloud database seamlessly. It provides methods for various database operations.
22
-
This package is designed to simplify database operations in PHP applications, making it easier than ever to work with SQLite Cloud.
19
+
## Configure your database connection
20
+
21
+
- In your SQLite Cloud account dashboard, click on `Show connection strings`, copy the Connection String, and replace `<your-connection-string>` below.
- You can modify the connection string to include the name of the database to query.
28
+
- Here, the provided port (`8860`) and database (`chinook.sqlite`) will query the sample dataset that comes pre-loaded with SQLite Cloud. Replace to query your own datasets.
Copy file name to clipboardExpand all lines: sqlite-cloud/sdks/swift/introduction.mdx
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,24 +27,30 @@ let package = Package(
27
27
28
28
1.**RECOMMENDED**: Use the `apikey` connection string.
29
29
30
-
In your SQLite Cloud account dashboard, click on `Show connection strings`, copy the Connection String, and replace `<your-connection-string>` below.
30
+
-In your SQLite Cloud account dashboard, click on `Show connection strings`, copy the Connection String, and replace `<your-connection-string>` below.
31
31
32
32
```swift
33
33
let configuration =SQLiteCloudConfig(connectionString: "<your-connection-string>")
34
34
```
35
35
36
+
- You can modify the connection string to include the name of the database to query.
37
+
38
+
```swift
39
+
let configuration =SQLiteCloudConfig(connectionString: "sqlitecloud://{hostname}:8860/{database}?apikey={apikey}")
40
+
```
41
+
36
42
2. Use a parameterized connection string.
37
43
38
-
- In your SQLite Cloud account dashboard, click on a Node, copy the Deployment string, and replace `{hostname}` below.
44
+
- In your SQLite Cloud account dashboard, click on `Show connection strings`, copy the Deployment string, and replace `{hostname}` below.
39
45
- In your dashboard left nav, select Settings, then Users. Copy your username and replace `{username}`.
40
46
- In your User's row, click the down chevron, then Edit. Enter a Password and Save. Replace `{password}`.
41
-
-The provided port and database will query the sample dataset that comes pre-loaded with SQLite Cloud. Replace both for your own datasets.
47
+
-Here, the provided port (`8860`) and database (`chinook.sqlite`) will query the sample dataset that comes pre-loaded with SQLite Cloud. Replace to query your own datasets.
42
48
43
49
```swift
44
50
let configuration =SQLiteCloudConfig(connectionString: "sqlitecloud://{username}:{password}@{hostname}:8860/chinook.sqlite")
45
51
```
46
52
47
-
3. Pass each connection string parameter.
53
+
3. Pass each connection string parameter explicitly.
48
54
49
55
```swift
50
56
let configuration =SQLiteCloudConfig(hostname: {hostname}, username: {username}, password: {password}, port: .default)
0 commit comments