Skip to content

Commit 4790988

Browse files
authored
Merge pull request #1 from planet-a-ventures/joscha/database-support
feat: database support
2 parents e1d6932 + ea97a02 commit 4790988

File tree

11 files changed

+491
-60
lines changed

11 files changed

+491
-60
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,6 @@ secrets.toml
178178

179179
.DS_Store
180180

181-
.python-version
181+
.python-version
182+
183+
/*.json

.yamlfmt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ gitignore_excludes: true
22
eof_newline: true
33
exclude:
44
- .yamllint
5-
- .pre-commit-config.yaml
6-
- dlt_source_notion/model/spec
5+
- .pre-commit-config.yaml

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ Currently loads the following data:
1515
| -- | -- |
1616
| `persons` | Items of the `user` model of type `person` |
1717
| `bots` | Items of the `user` model of type `bot` |
18+
| `database_<name>_<shorthash>` | The database content (pages) of a given database. Columns are all global page columns + selected columns of properties |
19+
| `databases` | All metadata of each loaded database. Has the title and a reference to the database table as well. |
20+
| `databases__properties` | Column \<-> Label mapping for each unfiltered database property |
21+
| `options_<name>_<shorthash>` | All options of a `select` or `multi_select` in one of the loaded databases. |
22+
23+
`<shorthash>` refers to the hashed `id` of an entity.
24+
The hash is a 4-bit BLAKE2b hash.
1825

1926
## Why are you not using the `dlt-hub/verified-sources` notion source / Differences
2027

@@ -26,6 +33,8 @@ has a few drawbacks:
2633
Once you make changes to it, it effectively becomes a fork,
2734
making it hard to update after the fact.
2835
- This makes use of a preexisting client implementation
36+
- And Pydantic types for Notion entities,
37+
which makes this implementation a lot more stable
2938

3039
## Usage
3140

devenv.lock

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"devenv": {
44
"locked": {
55
"dir": "src/modules",
6-
"lastModified": 1741068816,
6+
"lastModified": 1742320965,
77
"owner": "cachix",
88
"repo": "devenv",
9-
"rev": "9f6da63c162ad86b6fb84edcbd8c447fdc411c3d",
9+
"rev": "6bde92766ddd3ee1630029a03d36baddd51934e2",
1010
"type": "github"
1111
},
1212
"original": {
@@ -55,10 +55,10 @@
5555
]
5656
},
5757
"locked": {
58-
"lastModified": 1740915799,
58+
"lastModified": 1742300892,
5959
"owner": "cachix",
6060
"repo": "git-hooks.nix",
61-
"rev": "42b1ba089d2034d910566bf6b40830af6b8ec732",
61+
"rev": "ea26a82dda75bee6783baca6894040c8e6599728",
6262
"type": "github"
6363
},
6464
"original": {
@@ -122,12 +122,28 @@
122122
"type": "github"
123123
}
124124
},
125+
"nixpkgs-unstable": {
126+
"locked": {
127+
"lastModified": 1742272065,
128+
"owner": "nixos",
129+
"repo": "nixpkgs",
130+
"rev": "3549532663732bfd89993204d40543e9edaec4f2",
131+
"type": "github"
132+
},
133+
"original": {
134+
"owner": "nixos",
135+
"ref": "nixpkgs-unstable",
136+
"repo": "nixpkgs",
137+
"type": "github"
138+
}
139+
},
125140
"root": {
126141
"inputs": {
127142
"devenv": "devenv",
128143
"git-hooks": "git-hooks",
129144
"nixpkgs": "nixpkgs",
130145
"nixpkgs-python": "nixpkgs-python",
146+
"nixpkgs-unstable": "nixpkgs-unstable",
131147
"pre-commit-hooks": [
132148
"git-hooks"
133149
]

devenv.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@
66
...
77
}:
88

9+
let
10+
pkgs-unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.system; };
11+
in
912
{
1013
packages = [
1114
pkgs.git
1215
pkgs.bash
16+
pkgs.python312Packages.setuptools
1317
];
1418

1519
languages.python.enable = true;
1620
languages.python.uv.enable = true;
17-
languages.python.uv.package = pkgs.uv;
21+
languages.python.uv.package = pkgs-unstable.python312Packages.uv;
1822
languages.python.uv.sync.enable = true;
1923
languages.python.uv.sync.allExtras = true;
2024
languages.python.venv.enable = true;

devenv.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
inputs:
22
nixpkgs:
33
url: github:cachix/devenv-nixpkgs/rolling
4+
nixpkgs-unstable:
5+
url: github:nixos/nixpkgs/nixpkgs-unstable
46
nixpkgs-python:
57
url: github:cachix/nixpkgs-python
68
inputs:

0 commit comments

Comments
 (0)