Skip to content

Commit

Permalink
Documentation fixes (#96)
Browse files Browse the repository at this point in the history
- Added a "SQL Compliance" page (that is not yet complete) but it enough
to get the ball rolling on fleshing out exactly which features are
missing before we can claim a v1.0.0

- Updated the README to be a lot more helpful with quick links.

- Fixed some formatting that was previously breaking the build.

- Added a "Transactions" and "Installing & Updating" documentation
pages.

- Added the readthedocs.yaml configuration file which is the recommended
way and also cleaned up the existing conf files and pinned the python
dependencies (as recommended).
  • Loading branch information
elliotchance authored Jun 20, 2022
1 parent 04071ff commit 9f82626
Show file tree
Hide file tree
Showing 22 changed files with 453 additions and 280 deletions.
26 changes: 19 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
.PHONY: bench bench-on-disk bench-memory fmt fmt-verify test examples vsql grammar sql-test docs
.PHONY: bench bench-on-disk bench-memory fmt fmt-verify test examples vsql grammar sql-test docs clean-docs

# Is not used at the moment. It is useful for testing options like different
# `-gc` values.
BUILD_OPTIONS =

# Ideally we compile with "-prod" because it should make the resulting binaries
# faster. However, this has to be disabled for now.
# See https://github.com/elliotchance/vsql/issues/97
PROD = # -prod

# Binaries

vsql:
v -prod cmd/vsql.v
v $(BUILD_OPTIONS) $(PROD) cmd/vsql.v

# Documentation

docs:
cd docs && make html

clean-docs:
cd docs && make clean

# Grammar (BNF)

grammar:
Expand All @@ -27,13 +39,13 @@ fmt-verify:
# Tests

test:
v -stats -prod test vsql
v -stats $(BUILD_OPTIONS) $(PROD) test vsql

btree-test:
v -stats -prod test vsql/btree_test.v
v -stats $(BUILD_OPTIONS) $(PROD) test vsql/btree_test.v

sql-test:
v -stats test vsql/sql_test.v
v -stats $(BUILD_OPTIONS) $(PROD) test vsql/sql_test.v

# Examples

Expand All @@ -50,7 +62,7 @@ examples/%:
bench: bench-on-disk bench-memory

bench-on-disk:
v run cmd/vsql.v bench
v run $(PROD) cmd/vsql.v bench

bench-memory:
v run cmd/vsql.v bench -file ':memory:'
v run $(PROD) cmd/vsql.v bench -file ':memory:'
34 changes: 29 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
vsql
====
✌️ vsql
======

vsql is a single-file SQL database written in pure [V](https://vlang.io) with
no dependencies.
vsql is a [single-file](https://vsql.readthedocs.io/en/latest/cli.html) or
[PostgreSQL-server compatible](https://vsql.readthedocs.io/en/latest/server.html),
[transactional](https://vsql.readthedocs.io/en/latest/transaction.html),
[SQL-compliant](https://vsql.readthedocs.io/en/latest/sql-compliance.html)
database written in pure [V](https://vlang.io) with zero dependencies.

View documentation at [vsql.readthedocs.io](https://vsql.readthedocs.io/).
After
[installing or updating](https://vsql.readthedocs.io/en/latest/install.html),
you can use vsql
[within your V applications](https://vsql.readthedocs.io/en/latest/v-module.html),
interact with database files using the
[CLI](https://vsql.readthedocs.io/en/latest/cli.html), or connect to a database
using the
[built-in PostgreSQL-compatible server](https://vsql.readthedocs.io/en/latest/server.html).

See the full documentation at [vsql.readthedocs.io](https://vsql.readthedocs.io/)
or use one of the quick links:

- [FAQ](https://vsql.readthedocs.io/en/latest/faq.html)
- [CLI](https://vsql.readthedocs.io/en/latest/cli.html)
- [Supported PostgreSQL clients](https://vsql.readthedocs.io/en/latest/supported-clients.html)
- [Features](https://vsql.readthedocs.io/en/latest/features.html)
- [SQL Reference](https://vsql.readthedocs.io/en/latest/features.html)
- [Contributing](https://vsql.readthedocs.io/en/latest/contributing.html)
- [Data Types](https://vsql.readthedocs.io/en/latest/data-types.html)
- [Functions](https://vsql.readthedocs.io/en/latest/functions.html)
- [SQLSTATE](https://vsql.readthedocs.io/en/latest/sqlstate.html)
- [SQL Compliance](https://vsql.readthedocs.io/en/latest/sql-compliance.html)
4 changes: 2 additions & 2 deletions cmd/vsql.v
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ fn cli_command(cmd cli.Command) ? {
print_version()

mut db := vsql.open(cmd.args[0])?

for {
print('vsql> ')
query := os.get_line()

if query != "" {
if query != '' {
start := time.ticks()
result := db.query(query)?
for row in result {
Expand Down
1 change: 1 addition & 0 deletions docs/appendix.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ Appendix
functions.rst
keywords.rst
operators.rst
sql-compliance.rst
sqlstate.rst
Loading

0 comments on commit 9f82626

Please sign in to comment.