Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 3fb5af2

Browse files
author
Sergey Vasilyev
authored
Merge branch 'master' into redshift-super-support
2 parents 85ded0e + 78d07f1 commit 3fb5af2

26 files changed

+1189
-705
lines changed

README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
**THE PROJECT IS MERGED INTO [data-diff](https://github.com/datafold/data-diff) ON 2023-04-20 AND IS MAINTAINED THERE.**
2+
3+
**THIS REPO IS FOR HISTORIC REFERENCES ONLY.**
4+
15
# Sqeleton
26

37
**Under construction!**
@@ -12,6 +16,8 @@ It consists of -
1216

1317
It is comparable to other libraries such as SQLAlchemy or PyPika, in terms of API and intended audience. However there are several notable ways in which it is different.
1418

19+
## Overview
20+
1521
### Built for performance
1622

1723
- Multi-threaded by default -
@@ -31,11 +37,13 @@ This feature can be also used to inform the query-builder, either as an alternat
3137

3238
The schema is used for validation when building expressions, making sure the names are correct, and that the data-types align.
3339

40+
(Still WIP)
41+
3442
### Multi-database access
3543

3644
Sqeleton is designed to work with several databases at the same time. Its API abstracts away as many implementation details as possible.
3745

38-
Databases we support:
46+
Databases we fully support:
3947

4048
- PostgreSQL >=10
4149
- MySQL
@@ -51,11 +59,28 @@ Databases we support:
5159
- DuckDB >=0.6
5260
- SQLite (coming soon)
5361

54-
55-
### Documentation
62+
## Documentation
5663

5764
[Read the docs!](https://sqeleton.readthedocs.io)
5865

66+
Or jump straight to the [introduction](https://sqeleton.readthedocs.io/en/latest/intro.html).
67+
68+
### Install
69+
70+
Install using pip:
71+
72+
```bash
73+
pip install sqeleton
74+
```
75+
76+
It is recommended to install the driver dependencies using pip's `[]` syntax:
77+
78+
```bash
79+
pip install 'sqeleton[mysql, postgresql]'
80+
```
81+
82+
Read more in [install / getting started.](https://sqeleton.readthedocs.io/en/latest/install.html)
83+
5984
### Basic usage
6085

6186
```python

docs/conn_editor.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Connection Editor
2+
3+
A common complaint among new users was the difficulty in setting up the connections.
4+
5+
Connection URLs are admittedly confusing, and editing `.toml` files isn't always straight-forward either.
6+
7+
To ease this initial difficulty, we added a `textual`-based TUI tool to sqeleton, that allows users to edit configuration files and test the connections while editing them.
8+
9+
## Install
10+
11+
This tool needs `textual` to run. You can install it using:
12+
13+
```bash
14+
pip install 'sqeleton[tui]'
15+
```
16+
17+
Make sure you also have drivers for whatever database connection you're going to edit!
18+
19+
## Run
20+
21+
Once everything is installed, you can run the editor with the following command:
22+
23+
```bash
24+
sqeleton conn-editor <conf_path.toml>
25+
```
26+
27+
Example:
28+
29+
```bash
30+
sqeleton conn-editor ~/dbs.toml
31+
```
32+
33+
The available actions and hotkeys will be listed in the status bar.
34+
35+
Note: using the connection editor will delete comments and reformat the file!
36+
37+
We recommend backing up the configuration file before editing it.

docs/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
:caption: API Reference
44
:hidden:
55

6+
install
67
intro
78
supported-databases
9+
conn_editor
810
python-api
911

1012
Sqeleton
@@ -26,8 +28,10 @@ For more information, `See our README <https://github.com/datafold/sqeleton#read
2628
Resources
2729
---------
2830

31+
- :doc:`install`
2932
- :doc:`intro`
3033
- :doc:`supported-databases`
34+
- :doc:`conn_editor`
3135
- :doc:`python-api`
3236
- Source code (git): `<https://github.com/datafold/sqeleton>`_
3337

docs/install.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Install / Get started
2+
3+
Sqeleton can be installed using pip:
4+
5+
```
6+
pip install sqeleton
7+
```
8+
9+
## Database drivers
10+
11+
To ensure that the database drivers are compatible with sqeleton, we recommend installing them along with sqeleton, using pip's `[]` syntax:
12+
13+
- `pip install 'sqeleton[mysql]'`
14+
15+
- `pip install 'sqeleton[postgresql]'`
16+
17+
- `pip install 'sqeleton[snowflake]'`
18+
19+
- `pip install 'sqeleton[presto]'`
20+
21+
- `pip install 'sqeleton[oracle]'`
22+
23+
- `pip install 'sqeleton[trino]'`
24+
25+
- `pip install 'sqeleton[clickhouse]'`
26+
27+
- `pip install 'sqeleton[vertica]'`
28+
29+
- For BigQuery, see: https://pypi.org/project/google-cloud-bigquery/
30+
31+
_Some drivers have dependencies that cannot be installed using `pip` and still need to be installed manually._
32+
33+
34+
It is also possible to install several databases at once. For example:
35+
36+
```bash
37+
pip install 'sqeleton[mysql, postgresql]'
38+
```
39+
40+
Note: Some shells use `"` for escaping instead, like:
41+
42+
```bash
43+
pip install "sqeleton[mysql, postgresql]"
44+
```
45+
46+
## Connection editor
47+
48+
Sqeleton provides a TUI connection editor, that can be installed using:
49+
50+
```bash
51+
pip install 'sqeleton[tui]'
52+
```
53+
54+
Read more [here](conn_editor.md).
55+
56+
## What's next?
57+
58+
Read the [introduction](intro.md) and start coding!

docs/intro.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,12 @@ from sqeleton.abcs.mixins import AbstractMixin_NormalizeValue, AbstractMixin_Ran
440440

441441
connect = sqeleton.connect.load_mixins(AbstractMixin_NormalizeValue)
442442
ddb = connect("duckdb://:memory:")
443-
print(ddb.dialect.normalize_boolean("bool", None) == "bool::INTEGER::VARCHAR")
443+
print(ddb.dialect.normalize_boolean("bool", None))
444444
# Outputs:
445445
# bool::INTEGER::VARCHAR
446446
```
447447

448-
Each database is already aware of the available mixin implementation, because it was defined with the `MIXINS` attribute. We're only using the abstract mixins to select the mixins we want to use.
448+
Each database is already aware of the available mixin implementations, because it was defined with the `MIXINS` attribute. We're only using the abstract mixins to select the mixins we want to use.
449449

450450
#### List of mixins
451451

@@ -463,6 +463,12 @@ List of available abstract mixins:
463463

464464
- `AbstractMixin_TimeTravel` - Only snowflake & bigquery
465465

466+
- `AbstractMixin_OptimizerHints` - Only oracle & mysql
467+
468+
More will be added in the future.
469+
470+
Note that it's still possible to use user-defined mixins that aren't on this list.
471+
466472
#### Unimplemented Mixins
467473

468474
Trying to load a mixin that isn't implemented by all databases, will fail:

0 commit comments

Comments
 (0)