Skip to content

feat: database support #1

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

Merged
merged 16 commits into from
Mar 20, 2025
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,6 @@ secrets.toml

.DS_Store

.python-version
.python-version

/*.json
3 changes: 1 addition & 2 deletions .yamlfmt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ gitignore_excludes: true
eof_newline: true
exclude:
- .yamllint
- .pre-commit-config.yaml
- dlt_source_notion/model/spec
- .pre-commit-config.yaml
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ Currently loads the following data:
| -- | -- |
| `persons` | Items of the `user` model of type `person` |
| `bots` | Items of the `user` model of type `bot` |
| `database_<name>_<shorthash>` | The database content (pages) of a given database. Columns are all global page columns + selected columns of properties |
| `databases` | All metadata of each loaded database. Has the title and a reference to the database table as well. |
| `databases__properties` | Column \<-> Label mapping for each unfiltered database property |
| `options_<name>_<shorthash>` | All options of a `select` or `multi_select` in one of the loaded databases. |

`<shorthash>` refers to the hashed `id` of an entity.
The hash is a 4-bit BLAKE2b hash.

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

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

## Usage

Expand Down
24 changes: 20 additions & 4 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1741068816,
"lastModified": 1742320965,
"owner": "cachix",
"repo": "devenv",
"rev": "9f6da63c162ad86b6fb84edcbd8c447fdc411c3d",
"rev": "6bde92766ddd3ee1630029a03d36baddd51934e2",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -55,10 +55,10 @@
]
},
"locked": {
"lastModified": 1740915799,
"lastModified": 1742300892,
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "42b1ba089d2034d910566bf6b40830af6b8ec732",
"rev": "ea26a82dda75bee6783baca6894040c8e6599728",
"type": "github"
},
"original": {
Expand Down Expand Up @@ -122,12 +122,28 @@
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1742272065,
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3549532663732bfd89993204d40543e9edaec4f2",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"git-hooks": "git-hooks",
"nixpkgs": "nixpkgs",
"nixpkgs-python": "nixpkgs-python",
"nixpkgs-unstable": "nixpkgs-unstable",
"pre-commit-hooks": [
"git-hooks"
]
Expand Down
6 changes: 5 additions & 1 deletion devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@
...
}:

let
pkgs-unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.system; };
in
{
packages = [
pkgs.git
pkgs.bash
pkgs.python312Packages.setuptools
];

languages.python.enable = true;
languages.python.uv.enable = true;
languages.python.uv.package = pkgs.uv;
languages.python.uv.package = pkgs-unstable.python312Packages.uv;
languages.python.uv.sync.enable = true;
languages.python.uv.sync.allExtras = true;
languages.python.venv.enable = true;
Expand Down
2 changes: 2 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling
nixpkgs-unstable:
url: github:nixos/nixpkgs/nixpkgs-unstable
nixpkgs-python:
url: github:cachix/nixpkgs-python
inputs:
Expand Down
Loading