Skip to content

Commit eba2582

Browse files
authored
docs: Fix minor style/grammar issues in markdown files (#1931)
The docs were somewhat inconsistent with markdown formatting which should be mostly cleaned up now. The cleanup was focused on the libsql specific docs (meaning all markdown files except in the `vendored`, `libsql-sqlite3`, and `libsql-ffi/bundled` directories) A `.markdownlint.yaml` file was also added to help with maintenance in the future. Prose should be mostly identical except for fixing grammar issues.
2 parents 687d23e + 69370ba commit eba2582

32 files changed

+578
-515
lines changed

.markdownlint.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Default state for all rules
2+
default: true
3+
4+
# MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.37.3/doc/md010.md
5+
MD010:
6+
# Include code blocks
7+
code_blocks: false
8+
# Fenced code languages to ignore
9+
ignore_code_languages: []
10+
# Number of spaces for each hard tab
11+
spaces_per_tab: 4
12+
13+
# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.37.3/doc/md013.md
14+
MD013: false
15+
16+
# MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.37.3/doc/md024.md
17+
MD024:
18+
# Only check sibling headings
19+
siblings_only: true
20+
21+
# MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.37.3/doc/md033.md
22+
MD033:
23+
# Allowed elements
24+
allowed_elements:
25+
- p

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ representative at an online or offline event.
6161

6262
Instances of abusive, harassing, or otherwise unacceptable behavior may be
6363
reported to the community leaders responsible for enforcement at
64-
64+
6565
All complaints will be reviewed and investigated promptly and fairly.
6666

6767
All community leaders are obligated to respect the privacy and security of the
@@ -131,4 +131,3 @@ For answers to common questions about this code of conduct, see the FAQ at
131131
[Mozilla CoC]: https://github.com/mozilla/diversity
132132
[FAQ]: https://www.contributor-covenant.org/faq
133133
[translations]: https://www.contributor-covenant.org/translations
134-

CONTRIBUTING.md

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,51 @@ Thank you for your interest in contributing to libsql! We welcome contributions
44

55
Before you start, please take a moment to review the guidelines outlined below.
66

7-
# Code of Conduct
7+
## Code of Conduct
88

99
Please note that we have a Code of Conduct in place to ensure a positive and inclusive environment for everyone involved.
1010

11-
Getting Started
12-
13-
Fork the repository.
14-
Clone your forked repository to your local machine.
15-
Create a new branch for your feature or bug fix: git checkout -b feature-name.
16-
Make your changes and test thoroughly.
17-
Commit your changes with descriptive commit messages.
18-
Push your changes to your forked repository: git push origin feature-name.
19-
Submit a pull request to the main branch of the original repository.
20-
Contribution Guidelines
21-
22-
All contributions should be well-documented and follow the existing code style.
23-
Include tests for any new functionality or bug fixes.
24-
Update documentation as necessary, including any relevant README or usage guides.
25-
Maintain backward compatibility whenever possible.
26-
Follow the Git commit message guidelines for consistent commit messages.
27-
Review the existing issues and pull requests to avoid duplicating efforts.
28-
Pull Request Process
29-
30-
Ensure that your pull request addresses a specific issue. If there isn't an issue, consider creating one first.
31-
Clearly describe the problem or feature in your pull request and reference the relevant issue.
32-
Provide steps to reproduce and test your changes if applicable.
33-
Ensure that your branch is up-to-date with the latest changes from the main branch.
34-
All checks (tests, formatting, etc.) must pass before your pull request can be merged.
35-
After addressing review comments, your pull request will be merged by a project maintainer.
36-
Documentation
11+
### Getting Started
12+
13+
* Fork the repository.
14+
* Clone your forked repository to your local machine.
15+
* Create a new branch for your feature or bug fix: `git checkout -b feature-name`.
16+
* Make your changes and test thoroughly.
17+
* Commit your changes with descriptive commit messages.
18+
* Push your changes to your forked repository: `git push origin feature-name`.
19+
* Submit a pull request to the main branch of the original repository.
20+
21+
### Contribution Guidelines
22+
23+
* All contributions should be well-documented and follow the existing code style.
24+
* Include tests for any new functionality or bug fixes.
25+
* Update documentation as necessary, including any relevant README or usage guides.
26+
* Maintain backward compatibility whenever possible.
27+
* Follow the Git commit message guidelines for consistent commit messages.
28+
* Review the existing issues and pull requests to avoid duplicating efforts.
29+
30+
### Pull Request Process
31+
32+
* Ensure that your pull request addresses a specific issue.
33+
* If there isn't an issue, consider creating one first.
34+
* Clearly describe the problem or feature in your pull request and reference the relevant issue.
35+
* Provide steps to reproduce and test your changes if applicable.
36+
* Ensure that your branch is up-to-date with the latest changes from the main branch.
37+
* All checks (tests, formatting, etc.) must pass before your pull request can be merged.
38+
* After addressing review comments, your pull request will be merged by a project maintainer.
39+
40+
### Documentation
3741

3842
Help us improve the project's documentation by fixing typos, clarifying language, or adding missing information. Documentation improvements can be submitted as pull requests.
3943

40-
Reporting Issues
44+
### Reporting Issues
4145

4246
If you encounter a bug or have a suggestion for the project, please open an issue using the provided issue template. Include as much detail as possible to help us understand and address the problem.
4347

44-
Getting Help
48+
### Getting Help
4549

4650
If you need assistance, have questions, or want to discuss ideas, you can:
4751

4852
Join our Discord server and chat with the community.
4953
Mention @maintainer in your issue or pull request for a faster response from project maintainers.
5054
We appreciate your time and effort in contributing to libsql!
51-

README-libsql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This libSQL API is an experimental, batteries-included library built on top of S
1313

1414
## Getting Started
1515

16-
* [Rust](core)
16+
* [Rust](core)
1717
* [Python](https://github.com/libsql/libsql-experimental-python)
1818
* [JavaScript](https://github.com/libsql/libsql-experimental-node)
1919
* [Go](https://github.com/libsql/go-libsql)

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- markdownlint-disable MD033 MD041 -->
2+
13
<p align="center">
24
<a href="https://turso.tech/libsql">
35
<img alt="libSQL by Turso" src="https://github.com/tursodatabase/libsql/assets/950181/6c8679e7-65a9-4777-b08a-2ddf4321160f" width="1000">
@@ -33,7 +35,7 @@
3335

3436
## Documentation
3537

36-
We aim to evolve it to suit many more use cases than SQLite was originally designed for, and plan to use third-party OSS code wherever it makes sense.
38+
We aim to evolve it to suit many more use cases than SQLite was originally designed for, and plan to use third-party OSS code wherever it makes sense.
3739

3840
libSQL has many great features, including:
3941

@@ -54,19 +56,22 @@ The comprehensive description can be found [here](libsql-sqlite3/doc/libsql_exte
5456
### Official Drivers
5557

5658
* [TypeScript / JS](https://github.com/tursodatabase/libsql-client-ts)
57-
* [Rust](libsql)
59+
* [Rust](libsql)
5860
* [Go](https://github.com/tursodatabase/go-libsql)
5961
* [Go (no CGO)](https://github.com/tursodatabase/libsql-client-go)
6062

6163
### Experimental Drivers
64+
6265
* [Python](https://github.com/tursodatabase/libsql-experimental-python) (experimental)
6366
* [C](bindings/c) (experimental)
6467

6568
### Community Drivers
69+
6670
* [PHP](https://github.com/tursodatabase/turso-client-php)
6771
* [D](https://github.com/pdenapo/libsql-d) (experimental, based on the C driver)
6872

6973
### GUI Support
74+
7075
* [Beekeeper Studio](https://www.beekeeperstudio.io/db/libsql-client/) &mdash; macOS, Windows, and Linux
7176
* [Outerbase](https://www.outerbase.com) &mdash; Runs in the browser
7277
* [TablePlus](https://tableplus.com) &mdash; macOS, Windows, and Linux
@@ -95,6 +100,7 @@ libsql>
95100
```
96101

97102
### Docker
103+
98104
To run libSQL using docker, refer to the [Docker Docs](docs/DOCKER.md)
99105

100106
## Why a fork?
@@ -105,15 +111,15 @@ But despite having its code available, SQLite famously doesn't accept external c
105111

106112
There have been other forks in the past, but they all focus on a specific technical difference. We aim to be a community where people can contribute from many different angles and motivations.
107113

108-
We want to see a world where everyone can benefit from all of the great ideas and hard work that the SQLite community contributes back to the codebase. Community contributions work well, because we’ve done it before. If this was possible, what do you think SQLite could become?
114+
We want to see a world where everyone can benefit from all the great ideas and hard work that the SQLite community contributes back to the codebase. Community contributions work well, because we’ve done it before. If this was possible, what do you think SQLite could become?
109115

110116
You can read more about our goals and motivation in our [product vision](https://turso.tech/libsql-manifesto).
111117

112118
## Compatibility with SQLite
113119

114120
Compatibility with SQLite is of great importance for us. But it can mean many things. So here's our stance:
115121

116-
* **The file format**: libSQL will always be able to ingest and write the SQLite file format. We would love to add extensions like encryption, and CRC that require the file to be changed. But we commit to always doing so in a way that generates standard sqlite files if those features are not used.
122+
* **The file format**: libSQL will always be able to ingest and write the SQLite file format. We would love to add extensions like encryption, and CRC that require the file to be changed. But we commit to always doing so in a way that generates standard SQLite files if those features are not used.
117123
* **The API**: libSQL will keep 100% compatibility with the SQLite API, but we may add additional APIs.
118124
* **Embedded**: SQLite is an embedded database that can be consumed as a single .c file with its accompanying header. libSQL will always be embeddable, meaning it runs inside your process without needing a network connection. But we may change the distribution, so that object files are generated, instead of a single .c file.
119125

bindings/wasm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Developing
44

5-
```
5+
```console
66
wasm-pack build --target nodejs
77
node example.js
88
```

bottomless/README.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,51 @@
11
# Bottomless S3-compatible virtual WAL for libSQL
2-
##### Work in heavy progress!
2+
3+
## Work in heavy progress
34

45
This project implements a virtual write-ahead log (WAL) which continuously backs up the data to S3-compatible storage and is able to restore it later.
56

67
## How to build
7-
```
8+
9+
```shell
810
LIBSQL_DIR=/path/to/your/libsql/directory make
911
```
12+
1013
will produce a loadable `.so` libSQL extension with bottomless WAL implementation.
11-
```
14+
15+
```shell
1216
LIBSQL_DIR=/path/to/your/libsql/directory make release
1317
```
18+
1419
will do the same, but for release mode.
1520

1621
## Configuration
17-
By default, the S3 storage is expected to be available at `http://localhost:9000` (e.g. a local development [minio](https://min.io) server), and the auth information is extracted via regular S3 SDK mechanisms, i.e. environment variables and `~/.aws/credentials` file, if present. Ref: https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials_environment.html
22+
23+
By default, the S3 storage is expected to be available at `http://localhost:9000` (e.g. a local development [minio](https://min.io) server), and the auth information is extracted via regular S3 SDK mechanisms, i.e. environment variables and `~/.aws/credentials` file, if present. Ref: <https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials_environment.html>
1824

1925
Default endpoint can be overridden by an environment variable too, and in the future it will be available directly from libSQL as an URI parameter:
20-
```
26+
27+
```shell
2128
export LIBSQL_BOTTOMLESS_ENDPOINT='http://localhost:9042'
2229
```
2330

2431
Bucket used for replication can be configured with:
25-
```
32+
33+
```shell
2634
export LIBSQL_BOTTOMLESS_BUCKET='custom-bucket'
2735
```
2836

2937
On top of that, bottomless is implemented on top of the official [Rust SDK for S3](https://crates.io/crates/aws-sdk-s3), so all AWS-specific environment variables like `AWS_DEFAULT_REGION`, `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` also work, as well as the `~/.aws/credentials` file.
3038

3139
## How to use
40+
3241
From libSQL shell, load the extension and open a database file with `bottomless` WAL, e.g.:
42+
3343
```sql
3444
.load ../target/debug/bottomless
3545
.open file:test.db?wal=bottomless
3646
PRAGMA journal_mode=wal;
3747
```
48+
3849
Remember to set the journaling mode to `WAL`, which needs to be done at least once, before writing any content, otherwise the custom WAL implementation will not be used.
3950

4051
In order to customize logging, use `RUST_LOG` env variable, e.g. `RUST_LOG=info ./libsql`.
@@ -46,14 +57,18 @@ LIBSQL_DIR=/path/to/your/libsql/directory make test
4657
```
4758

4859
## CLI
60+
4961
The command-line interface supports browsing, restoring and removing snapshot generations.
5062
It can be installed as a standalone executable with:
63+
5164
```sh
5265
RUSTFLAGS="--cfg uuid_unstable" cargo install bottomless-cli
5366
```
67+
5468
Alternatively, bottomless-cli is available from the repository by running `cargo run`.
5569
Available commands:
56-
```
70+
71+
```console
5772
$ bottomless-cli --help
5873
Bottomless CLI
5974

@@ -75,8 +90,9 @@ Options:
7590
### Examples
7691

7792
#### Listing generations
78-
```
79-
[sarna@sarna-pc test]$ bottomless-cli -e http://localhost:9000 ls -v -l3
93+
94+
```console
95+
$ bottomless-cli -e http://localhost:9000 ls -v -l3
8096
e4eb3c21-ff53-7b2e-a6ea-ca396f4df9b1
8197
created at (UTC): 2022-12-23 08:24:52.500
8298
change counter: [0, 0, 0, 51]
@@ -106,7 +122,8 @@ e4eb3c22-0941-73eb-85df-4e8552a0e88c
106122
```
107123

108124
#### Restoring the database
109-
```
125+
126+
```console
110127
$ RUST_LOG=info bottomless-cli -e http://localhost:9000 restore
111128
2022-12-23T10:16:10.703557Z INFO bottomless::replicator: Bucket bottomless exists and is accessible
112129
2022-12-23T10:16:10.709526Z INFO bottomless_cli: Database: test.db
@@ -115,20 +132,24 @@ $ RUST_LOG=info bottomless-cli -e http://localhost:9000 restore
115132
```
116133

117134
#### Removing old snapshots
118-
```
135+
136+
```console
119137
$ bottomless-cli -e http://localhost:9000 rm -v --older-than 2022-12-15
120138
Removed 4 generations
121139
```
122140

123141
## Details
142+
124143
All page writes committed to the database end up being asynchronously replicated to S3-compatible storage.
125144
On boot, if the main database file is empty, it will be restored with data coming from the remote storage.
126145
If the database file is newer, it will be uploaded to the remote location with a new generation number.
127146
If a local WAL file is present and detected to be newer than remote data, it will be uploaded as well.
128147

129148
### Tests
149+
130150
A fully local test can be performed by using a local S3-compatible server, e.g. [Minio](https://min.io/). Assuming the server is available at HTTP port 9000,
131151
you can use the following scripts:
152+
132153
```sh
133154
cd test/
134155
export LIBSQL_BOTTOMLESS_ENDPOINT=http://localhost:9000

docs/ADMIN_API.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,33 @@ This document describes the admin API endpoints.
55
The admin API is used to manage namespaces on a `sqld` instance. Namespaces are isolated database within a same sqld instance.
66

77
To enable the admin API, and manage namespaces, two extra flags need to be passed to `sqld`:
8+
89
- `--admin-listen-addr <addr>:<port>`: the address and port on which the admin API should listen. It must be different from the user API listen address (whi defaults to port 8080).
910
- `--enable-namespaces`: enable namespaces for the instance. By default namespaces are disabled.
1011

1112
## Routes
1213

13-
```
14+
```HTTP
1415
POST /v1/namespaces/:namespace/create
1516
```
17+
1618
Create a namespace named `:namespace`.
1719
body:
20+
1821
```json
1922
{
2023
"dump_url"?: string,
2124
}
2225
```
2326

24-
```
27+
```HTTP
2528
DELETE /v1/namespaces/:namespace
2629
```
2730

2831
Delete the namespace named `:namespace`.
2932

30-
```
33+
```HTTP
3134
POST /v1/namespaces/:namespace/fork/:to
3235
```
36+
3337
Fork `:namespace` into new namespace `:to`

docs/BUILD-RUN.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ You can query sqld using one of the provided [client
2222
libraries](../libsql-server#client-libraries).
2323

2424
You can also use the [turso cli](https://docs.turso.tech/reference/turso-cli) to connect to the sqld instance:
25-
```
26-
turso db shell http://127.0.0.1:8080
25+
26+
```console
27+
turso db shell http://127.0.0.1:8080
2728
```
2829

2930
## Download a prebuilt binary
@@ -59,7 +60,7 @@ sqld --help
5960
## Using a prebuilt Docker image
6061

6162
The sqld release process publishes a Docker image to the GitHub Container
62-
Registry. The URL is https://ghcr.io/tursodatabase/libsql-server. You can run the latest image locally
63+
Registry. The URL is <https://ghcr.io/tursodatabase/libsql-server>. You can run the latest image locally
6364
on port 8080 with the following:
6465

6566
```bash
@@ -194,7 +195,5 @@ development.
194195
cargo xtask test
195196
```
196197

197-
198-
[sqld releases page]: https://github.com/libsql/sqld/releases
199198
[sqld container release tags]: https://github.com/libsql/sqld/pkgs/container/sqld
200199
[sqld release tags]: https://github.com/libsql/sqld/releases

0 commit comments

Comments
 (0)