Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libsql #136

Merged
merged 3 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions configuration/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,19 @@ These properties are as follows:

### Database

| Property | Description | Default | Since |
| ------------------------------ | ------------------------------------------------------------------------------------------- | ----------------------------------- | ---------------------- |
| db.url | URL to access Flipt database | file:/(OS Dependent)/flipt/flipt.db | v1.26.0 \*OS Dependent |
| db.protocol | Protocol (SQLite, MySQL, PostgreSQL, CockroachDB) for Flipt database (URL takes precedence) | | v0.18.0 |
| db.host | Host to access Flipt database (URL takes precedence) | | v0.18.0 |
| db.port | Port to access Flipt database (URL takes precedence) | | v0.18.0 |
| db.name | Name of Flipt database (URL takes precedence) | | v0.18.0 |
| db.user | User to access Flipt database (URL takes precedence) | | v0.18.0 |
| db.password | Password to access Flipt database (URL takes precedence) | | v0.18.0 |
| db.max_idle_conn | The maximum number of connections in the idle connection pool | 2 | v0.17.0 |
| db.max_open_conn | The maximum number of open connections to the database | unlimited | v0.17.0 |
| db.conn_max_lifetime | Sets the maximum amount of time in which a connection can be reused | unlimited | v0.17.0 |
| db.prepared_statements_enabled | Enable or disable prepared statements for database queries | true | v1.23.1 |
| Property | Description | Default | Since |
| ------------------------------ | ------------------------------------------------------------------- | ----------------------------------- | ---------------------- |
| db.url | URL to access Flipt database | file:/(OS Dependent)/flipt/flipt.db | v1.26.0 \*OS Dependent |
| db.protocol | Protocol for Flipt database (URL takes precedence) | | v0.18.0 |
| db.host | Host to access Flipt database (URL takes precedence) | | v0.18.0 |
| db.port | Port to access Flipt database (URL takes precedence) | | v0.18.0 |
| db.name | Name of Flipt database (URL takes precedence) | | v0.18.0 |
| db.user | User to access Flipt database (URL takes precedence) | | v0.18.0 |
| db.password | Password to access Flipt database (URL takes precedence) | | v0.18.0 |
| db.max_idle_conn | The maximum number of connections in the idle connection pool | 2 | v0.17.0 |
| db.max_open_conn | The maximum number of open connections to the database | unlimited | v0.17.0 |
| db.conn_max_lifetime | Sets the maximum amount of time in which a connection can be reused | unlimited | v0.17.0 |
| db.prepared_statements_enabled | Enable or disable prepared statements for database queries | true | v1.23.1 |

### Storage

Expand Down
51 changes: 33 additions & 18 deletions configuration/storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ description: This document describes how to configure Flipt's storage backend me

## Databases

Flipt supports [SQLite](https://www.sqlite.org/index.html), [PostgreSQL](https://www.postgresql.org/), [CockroachDB](https://www.cockroachlabs.com/) and
[MySQL](https://dev.mysql.com/) databases.
Flipt supports [SQLite](https://www.sqlite.org/index.html), [PostgreSQL](https://www.postgresql.org/), [CockroachDB](https://www.cockroachlabs.com/) and [MySQL](https://dev.mysql.com/) databases.

SQLite is enabled by default for simplicity, however, you should use PostgreSQL, MySQL, or CockroachDB if you intend to run multiple copies of Flipt in a high
availability configuration.
<Note>
As of [v1.29.0](https://github.com/flipt-io/flipt/releases/tag/v1.29.0), Flipt
also supports [libSQL](https://github.com/tursodatabase/libsql) which is a
fork of SQLite that can be accessed over a network via
[sqld](https://github.com/tursodatabase/libsql/tree/main/libsql-server).
</Note>

<Warning>
All databases except for SQLite must exist and be up and running before Flipt
will be able to connect to it.
</Warning>
SQLite is enabled by default for simplicity, however, you should use PostgreSQL, MySQL, or CockroachDB if you intend to run multiple copies of Flipt in a high availability configuration.

The database connection can be configured as follows:

Expand All @@ -32,6 +32,31 @@ db:
url: file:/var/opt/flipt/flipt.db
```

### LibSQL

See our [libSQL Example](https://github.com/flipt-io/flipt/blob/main/examples/database/libsql) for a working example of how to use libSQL with Flipt.

#### Local

```yaml
db:
# libsql: informs flipt to use libSQL
url: libsql://file:/var/opt/flipt/flipt.db
```

#### Remote

<Note>
If using [Turso](https://turso.tech/) you must use a [database auth
token](https://docs.turso.tech/reference/turso-cli#creating-a-database-token)
to access the database.
</Note>

```yaml
db: # http(s): informs flipt to use libSQL over HTTP(s) via sqld/Turso
url: https://db-[your-github-name].turso.io?authToken=[your-auth-token]
```

### PostgreSQL

```yaml
Expand Down Expand Up @@ -91,11 +116,6 @@ when the migration container exits, having no effect on your Flipt instance!

## Filesystem

<Note>
This feature was added as an experiment in Flipt `v1.23.0` and officially
supported in Flipt `v1.25.0`.
</Note>

The following backend types are designed to support declarative management of feature flag state.
In particular, they're designed to support GitOps practices with minimal external dependencies.

Expand Down Expand Up @@ -213,11 +233,6 @@ See our [GitOps Guide](/guides/get-going-with-gitops) for an example of how to s

### Object

<Note>
This feature was added as an experiment in Flipt `v1.24.0` and officially
supported in Flipt `v1.25.0`.
</Note>

The object storage type supports using a hosted object storage service as the source of truth for Flipt state configuration.
Currently, Flipt supports the [S3 API](https://aws.amazon.com/s3/) as a backend. This means the AWS S3 and open-source alternatives such as [Minio](https://github.com/minio/minio) can be leveraged as Flipt backends.

Expand Down