Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
f358071
improve drop_index (#660)
valq7711 May 30, 2021
bc86e6f
introduce CTE + RECURSIVE (#656)
valq7711 May 30, 2021
7351853
Use current_thread instead of currentThread method that was deprecate…
tirkarthi May 30, 2021
7237a87
Bug fix for range_error_message function (#665)
anonymous378 May 30, 2021
b9277a4
fixed pickle_raw, thank you valq7711
mdipierro May 30, 2021
da08532
moved to travis-ci.com
mdipierro Jun 26, 2021
6e1aa78
version 1.20210626.1, added utils/tags.py
mdipierro Jun 26, 2021
575ba67
version 1.20210626.2
mdipierro Jun 27, 2021
7ed213c
version 20210626.3, fixes missing folder
mdipierro Jun 27, 2021
c7451b2
Fixes to oracle.py (#667)
celsogodinho Jul 27, 2021
b3122d4
Fix "TypeError: '<' not supported between instances of 'int' and 'str…
dmatic Oct 9, 2021
25852a9
Fixed GHSL-2021-116 (GHSA-mv7q-fmfm-764m), thanks Giovanni
mdipierro Oct 15, 2021
21f9ad4
Only use TextIOWrapper if needed (#673)
jvanbraekel Nov 28, 2021
2565d15
20220114.1
mdipierro Jan 15, 2022
7d738a2
Make Expression instance hashable (#678)
valq7711 Feb 10, 2022
26c8793
Fix Tags import to import from tools and not utils (#679)
leonelcamara Feb 10, 2022
e44acb1
Fix appveyor fails due to wrong get-pip url (#680)
leonelcamara Feb 10, 2022
3ccf0e8
Merge branch 'master' of github.com:web2py/pydal
mdipierro Feb 12, 2022
7122794
version 20220213.1
mdipierro Feb 12, 2022
4c40984
Tag from path to tagpath, breaks backward compatiliby
mdipierro Feb 13, 2022
d7b24a9
version 20220213.2
mdipierro Feb 13, 2022
dbf94fd
fix sqlite in-memory (#683)
valq7711 Mar 22, 2022
f8b4be9
Adding experimental Snowflake support (#687)
KellerKev May 30, 2022
5dedc6c
snowflakeconnector should be optional
mdipierro May 30, 2022
0adf8be
Bug fix download e file_upload (#684)
dsinibaldi77 May 30, 2022
64ed5e7
better encoded_filename compression
mdipierro May 30, 2022
20f8373
v20220609.1
mdipierro Jun 10, 2022
daa85d4
fixed db.uuid(), thanks chriiistiian
mdipierro Jun 18, 2022
a6c4a4e
docs: Fix a few typos (#692)
timgates42 Jul 20, 2022
4d63590
Fix IS_IN_DB with multiple=True for single value (#688)
robinvandernoord Jul 20, 2022
a5a08ec
support onupdate, thanks RekGRpth and sorry it took me so long, fixxe…
mdipierro Jul 20, 2022
8c0f4ec
v20220720.1
mdipierro Jul 20, 2022
4b191da
Snowflake driver enhancement, now supports oauth and keypair authenti…
KellerKev Jul 21, 2022
e7a3bad
fix rows.render(i=0)
mdipierro Jul 21, 2022
7cd12c8
fixed csv_reader
mdipierro Jul 21, 2022
3b499b1
fixed sqlite:memory for py2
mdipierro Jul 21, 2022
c2163d3
skipping testCTE in py2 because sqlite3 in py2 does not support circu…
mdipierro Jul 21, 2022
b324a5c
reformatting everything
mdipierro Jul 21, 2022
3cfca40
removed unwanted print statement and fixed incorrect oracle escaping
mdipierro Jul 21, 2022
3581c70
v20220721.1
mdipierro Jul 21, 2022
e43a330
v20220725.1
mdipierro Jul 25, 2022
1c16b7b
Fix: Syntax error with SQLite3 and PyDAL #314 (#691)
XpycTee Jul 25, 2022
6899de6
build filenames for non-database upload fields (#695)
jpsteil Aug 3, 2022
1a15ad7
v20220807.1
mdipierro Aug 7, 2022
4630db3
Web2py filesystem issues (#697)
macneiln Aug 14, 2022
86386b4
version 20220814.1
mdipierro Aug 15, 2022
7282ed0
Added match_parameter in the oracle dialect (#699)
SymonRod Aug 20, 2022
142d26f
Update base.py (#700)
crc1021 Oct 17, 2022
2903a8f
sqlite placeholder correction (#702)
macneiln Oct 17, 2022
f47227e
version 20220916.1
mdipierro Oct 17, 2022
1ba6345
Fix license file name in MANIFEST.in (#703)
jameshilliard Nov 4, 2022
4d27307
Fixing expected lowercase letters in Snowflake SQL statements (#704)
KellerKev Nov 7, 2022
4e43b76
version 20221110.1
mdipierro Nov 11, 2022
402407e
allow _ in IS_ALPHANUMRIC as tests and massages suggest
mdipierro Nov 21, 2022
b171757
revert previous commit since \w includes _
mdipierro Nov 21, 2022
2e35532
fixed match_parameter
mdipierro May 7, 2023
48a7adb
validate_and_(insert/update) must return dict, not Row
mdipierro May 7, 2023
ef60cc0
black/isort everything
mdipierro May 7, 2023
2a77f13
version 20230507.3
mdipierro May 7, 2023
993a91b
version 20230511.1, fixed restapi
mdipierro May 12, 2023
0555721
version 20230521.1
mdipierro May 22, 2023
daf7555
allow Tags(...tag_table=db.existing_table)
mdipierro Oct 29, 2023
4f0cde3
fix postgres regexp TypeError 'match_parameter' (#706)
BachNTran Nov 9, 2023
fdc0ac4
use `object.__setattr__` to set attribute on `Table` (#708)
valq7711 Nov 9, 2023
e369aa5
Fix for validate_and_insert() and validate_and_update() in restapi.py…
chrda81 Nov 9, 2023
98c90b7
version 20231111.1
mdipierro Nov 12, 2023
41078cc
version 20231114.1, fixes tags
mdipierro Nov 15, 2023
0048722
version 20231114.2, better Makefile
mdipierro Nov 15, 2023
4d16c62
version 20231114.3, fixed tests, tags, reformatted
mdipierro Nov 15, 2023
4ffb9fb
shell.nix
mdipierro Nov 30, 2023
539438d
removed dir() and __dir__
mdipierro Dec 28, 2023
dc29e04
Add build-system to pyproject.toml (#713)
MatthewZMD Jan 16, 2024
bf2296d
version 20240428.1
mdipierro Apr 28, 2024
3210eb8
20240428.2
mdipierro Apr 28, 2024
831a880
allow uploading files via APIs
mdipierro May 30, 2024
e7110a0
better test of api image upload
mdipierro May 30, 2024
88287c1
IS_IN_DB get formatter from table by default
mdipierro May 30, 2024
209f8dd
version 20240529.1
mdipierro May 30, 2024
25e5976
experimental scheduler
mdipierro Jun 1, 2024
0480af6
completed the new scheduler
mdipierro Jun 2, 2024
d536d65
IS_SAFE validator
mdipierro Jun 2, 2024
c5c9edd
version 20240601.1
mdipierro Jun 2, 2024
23d7434
version 20240601.2
mdipierro Jun 2, 2024
ee60935
added scheduler to tests
mdipierro Jun 2, 2024
fed4768
version 20240601.3
mdipierro Jun 2, 2024
68d25e1
fixed IS_IN_SET(zero), thanks dgmanns
mdipierro Jun 21, 2024
ae9630b
version 20240713.1
mdipierro Jul 14, 2024
fa0e9e7
version 20240906.1, fixes _format in restapi
mdipierro Sep 7, 2024
e204852
Dropped broken Goole datastore support, Added google firestore suppor…
mdipierro Oct 22, 2024
6664937
version 20241027.1, deprecated datastore, welcome firestore
mdipierro Oct 28, 2024
9d22005
Update README.md (#719)
nicozanf Nov 12, 2024
a6ca10d
added legacy-cgi to test-requirements, thanks robinvandernoord
mdipierro Nov 12, 2024
ed103d3
as_trees allowing building trees starting from branches (root parents…
jgrazina Nov 12, 2024
038d84c
version 20241111.1
mdipierro Nov 12, 2024
d324a1e
testing github workflow tests
mdipierro Nov 12, 2024
dfd1ecf
testing github workflow tests - 2
mdipierro Nov 12, 2024
54bd8c1
testing github workflow tests - 3
mdipierro Nov 12, 2024
1745d3b
added github workflow build status badge
mdipierro Nov 12, 2024
7f5fd21
version 20241111.2
mdipierro Nov 12, 2024
4dda912
Remove utcnow() deprecation warning in test (#721)
nicozanf Nov 29, 2024
136e501
fixed IS_LIST_OF_EMAIL validator
mdipierro Nov 29, 2024
16c9395
fixed expression.with_alias(name) and added support for expression.wi…
mdipierro Nov 29, 2024
9a92f7e
Fix appveyor for mssql (#722)
nicozanf Dec 1, 2024
e471a24
version 20241201.1
mdipierro Dec 2, 2024
851f446
version 20241201.2
mdipierro Dec 2, 2024
b9c4f31
Fix scheduler wrong import of utcnow() (#723)
nicozanf Dec 5, 2024
172b15c
version 20241204.1
mdipierro Dec 5, 2024
88930e2
version 20241204.1
mdipierro Dec 5, 2024
b5a8c93
improved gae support, still problem with IS_NOT_IN_DB
mdipierro Dec 7, 2024
3899b29
Remove timezone from utcnow (#725)
mbelletti Dec 7, 2024
57bec7d
better IS_NOT_IN_DB and removed long
mdipierro Dec 7, 2024
f725019
fixed GAE support
mdipierro Dec 9, 2024
3937a08
fixed failed updates on firestore
mdipierro Dec 9, 2024
7abe43d
set field.referent when db._pending_references (#726)
laundmo Dec 25, 2024
045344f
changed github workflow
mdipierro Dec 25, 2024
2bdcab3
testing github workflow
mdipierro Dec 25, 2024
ea174b2
Massively simplify join logic (#729)
laundmo Feb 17, 2025
56687ec
reformatting and uv
mdipierro Feb 17, 2025
7367b0f
version 20250215.2
mdipierro Feb 17, 2025
fd88958
better with_alias handling, including proper flattening when the expr…
laundmo Feb 25, 2025
40ae97e
better Makefile build
mdipierro Feb 25, 2025
1240ed0
This reverts commit fd88958237b59df4388308f05c3a3528716b3d8b.
mdipierro Mar 1, 2025
afacba6
This reverts commit ea174b21d505c1e7436f7492c6bf7dea8b97b257.
mdipierro Mar 1, 2025
a69eda6
version 20250228.1
mdipierro Mar 1, 2025
ab15b71
validate time,date,datetime to prevent inserting invalid content
mdipierro May 2, 2025
acd6ef8
version 20250501.1
mdipierro May 2, 2025
ad4f1d5
version 20250501.2
mdipierro May 2, 2025
c834be1
fixed issue #733, alias and csv, thanks Massimiliano
mdipierro May 3, 2025
faeb5a2
fixed with alias again, thanks Massimiliano
mdipierro May 6, 2025
0179e9e
Include already existing JSON operators in other postgres adapters an…
jgrazina May 25, 2025
430773a
test.py
mdipierro May 26, 2025
ea95f76
first version of the QueryBuilder
mdipierro May 26, 2025
cdaaf79
added test for QueryBuilder
mdipierro May 26, 2025
ab414ca
version 20250525.1
mdipierro May 26, 2025
36f532a
version 20250525.2
mdipierro May 26, 2025
c769560
version 20250525.3
mdipierro May 26, 2025
f8192c2
pass table to QueryBuilder
mdipierro May 26, 2025
8db9842
version 20250526.1
mdipierro May 26, 2025
f48fa8e
deploy->publish
mdipierro May 26, 2025
430e638
version 20250526.2
mdipierro May 26, 2025
4922d2a
no more zombies
mdipierro May 26, 2025
e62a1d0
version 20250526.3
mdipierro May 26, 2025
ac5f292
version 20250526.4
mdipierro May 26, 2025
5906a06
version 20250607.1
mdipierro Jun 7, 2025
2285f99
fix insinstance -> isinstance (#736)
mbelletti Jun 7, 2025
8bf7740
version 20250607.2
mdipierro Jun 7, 2025
59a9a22
added two new default validators IS_LIST_OF_STRINGS and IS_LIST_OF_INTS
mdipierro Jun 22, 2025
d27aa9d
experimental pydal change, every non str field has a default validato…
mdipierro Jun 22, 2025
7b2f7dd
validators.Validator is not the default and not a pure abstract class
mdipierro Jun 22, 2025
972ebed
handling customization of formatting of None and json handling of null
mdipierro Jun 22, 2025
df08d00
version 20250622.1
mdipierro Jun 22, 2025
7e32cf9
always allow None for default validators
mdipierro Jun 29, 2025
1ac29d3
version 20250629.1, improved default validators
mdipierro Jun 29, 2025
1f63a4b
version 20250629.2, removed unwanted debug print
mdipierro Jun 29, 2025
77b00b5
Fix null passwords changed to '******' on forms (#737)
nicozanf Aug 3, 2025
a055762
Remove debug prints from objects.py (#738)
leonelcamara Aug 13, 2025
ee77a21
make enqueue_run return run_id
mdipierro Sep 1, 2025
d75fc2f
fixed twine
mdipierro Sep 1, 2025
25b8c9d
removed default field representation which breaks too many things
mdipierro Sep 7, 2025
0eaced5
version 20250906.1
mdipierro Sep 7, 2025
d3d7147
Update querybuilder.py (#740)
laundmo Sep 9, 2025
31f0bbf
version 20250908.1
mdipierro Sep 9, 2025
5236ab0
version 20250908.2
mdipierro Sep 9, 2025
ae79e55
Fixed _validate_fields, thanks Leonel
mdipierro Sep 11, 2025
271d43c
version 20250913.1
mdipierro Sep 13, 2025
7b2ce29
experimental field.type_name, field.referenced_table, field.reference…
mdipierro Sep 14, 2025
3dcc3f9
version 20250914.1
mdipierro Sep 14, 2025
73fc348
version 20250920.1, smarter default validators
mdipierro Sep 21, 2025
fd405e5
version 20250922.1, better default validator handling
mdipierro Sep 23, 2025
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
35 changes: 35 additions & 0 deletions .github/workflows/run_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: master-test

on:
push:
branches:
- master
- ombott-dev
pull_request:
branches:
- master

jobs:
build:

runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Everything
run: |
sudo apt-get install memcached libmemcached-tools
python -m pip install --upgrade pip
ls -l
python -m pip install -e ./
python -m pip install -r test-requirements.txt
- name: Test
run: |
python -m unittest tests
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
Thumbs.db
.DS_Store
pyDAL.egg-info/*
venv/*
test-venv/*
dist/*
build/*
.project
Expand Down
123 changes: 0 additions & 123 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pyDAL changelog
===============

Version 18.0
------------

Released on December 27th 2019

Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include LICENSE
include LICENSE.txt
include AUTHORS
include CHANGES
recursive-include tests *
Expand Down
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.PHONY: clean build install deploy test.sql
.PHONY: uv ruff test lock build deploy

clean:
rm dist/* || echo ''
python3 setup.py clean
build: clean
python3 setup.py build
install: build
python3 setup.py install
test.sql: install
python3 -m unittest tests.sql
deploy: build
#http://guide.python-distribute.org/creation.html
python3 setup.py sdist
twine upload dist/*
uv:
which uv || curl -LsSf https://astral.sh/uv/install.sh | sh
check: uv
uv tool run ruff check
format: uv
uv tool run ruff format
test: check
uv run --extra test -m unittest tests
build: test
rm -rf dist/* build/*
uv build
publish: build
uv run --extra manage python -m twine upload dist/*
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# pyDAL

[![pip version](https://img.shields.io/pypi/v/pydal.svg?style=flat-square)](https://pypi.python.org/pypi/pydal)
[![master-test](https://github.com/web2py/pydal/actions/workflows/run_test.yaml/badge.svg)](https://github.com/web2py/pydal/actions/workflows/run_test.yaml)
[![Coverage Status](https://img.shields.io/codecov/c/github/web2py/pydal.svg?style=flat-square)](https://codecov.io/github/web2py/pydal)
[![API Docs Status](https://readthedocs.org/projects/pydal/badge/?version=latest&style=flat-square)](http://pydal.rtfd.org/)

pyDAL is a pure Python Database Abstraction Layer.

It dynamically generates the SQL/noSQL in realtime using the specified dialect for the database backend, so that you do not have to write SQL code or learn different SQL dialects (the term SQL is used generically), and your code will be portable among different types of databases.
What makes pyDAL different from most of the other DALs is the syntax: it maps records to python dictionaries, which is simpler and closer to SQL. Other famous frameworks instead strictly rely on an Object Relational Mapping (ORM) like the Django ORM or the SQL Alchemy ORM, that maps tables to Python classes and rows to Objects.

pyDAL comes from the original web2py's DAL, with the aim of being compatible with any Python program. pyDAL doesn't require web2py and can be used in any Python context.

[![pip version](https://img.shields.io/pypi/v/pydal.svg?style=flat-square)](https://pypi.python.org/pypi/pydal)
[![Build Status](https://img.shields.io/travis/web2py/pydal/master.svg?style=flat-square&label=Travis-CI)](https://travis-ci.org/web2py/pydal)
[![MS Build Status](https://img.shields.io/appveyor/ci/web2py/pydal/master.svg?style=flat-square&label=Appveyor-CI)](https://ci.appveyor.com/project/web2py/pydal)
[![Coverage Status](https://img.shields.io/codecov/c/github/web2py/pydal.svg?style=flat-square)](https://codecov.io/github/web2py/pydal)
[![API Docs Status](https://readthedocs.org/projects/pydal/badge/?version=latest&style=flat-square)](http://pydal.rtfd.org/)
Historically pyDAL comes from the original web2py's DAL, with the aim of being compatible with any Python program. However, pyDAL nowadays is an indipendent package that can be used in any Python 3.7+ context.

## Installation

Expand All @@ -36,7 +36,7 @@ Chair
>>> db.commit()
```

The complete documentation is available on http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer
The complete updated documentation is available on [the py4web manual](https://py4web.com/_documentation/static/en/chapter-07.html)

## What's in the box?

Expand Down Expand Up @@ -67,6 +67,7 @@ pyDAL supports the following databases:
* SAPDB
* IMAP
* MongoDB
* Google Firestore

## License

Expand Down
32 changes: 13 additions & 19 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
build: false
image: Visual Studio 2019

services:
- mssql2014
- mssql2019

environment:
matrix:
- PYTHON: "C:/Python27"
adapter: "mssql"
- PYTHON: "C:/Python27"
adapter: "mssqln"
- PYTHON: "C:/Python34"
adapter: "mssql"
- PYTHON: "C:/Python34"
adapter: "mssqln"
- PYTHON: "C:/Python35"
adapter: "mssql"
- PYTHON: "C:/Python35"
adapter: "mssqln"
- PYTHON: "C:/Python36-x64"
- PYTHON: "C:/Python38-x64"
PY_VER: "3.8"
PYTHON_ARCH: "64"
adapter: "mssql"
- PYTHON: "C:/Python36-x64"
- PYTHON: "C:/Python38-x64"
PY_VER: "3.8"
PYTHON_ARCH: "64"
adapter: "mssqln"

Expand All @@ -29,23 +20,26 @@ clone_depth: 50
init:
- "ECHO %PYTHON%"
- set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
- powershell -Command "Get-Service | Where-Object { $_.DisplayName -like '*SQL*' }"
- ps: Start-Service -Name 'MSSQL$SQL2019' -ErrorAction SilentlyContinue


install:
- ps: Start-FileDownload https://bootstrap.pypa.io/get-pip.py
- appveyor DownloadFile https://bootstrap.pypa.io/pip/get-pip.py
- python get-pip.py
- pip install tox==1.9.2
- pip install tox==4.23.2
- pip install codecov

before_test:
- ps: |
while($LASTEXITCODE -ne 0)
{
& sqlcmd -S "(local)\SQL2014" -b -U "sa" -P "Password12!" -Q "CREATE DATABASE pydal COLLATE Latin1_General_CS_AS;" -d "master"
& sqlcmd -S "(local)" -U "sa" -P "Password12!" -Q "CREATE DATABASE pydal COLLATE Latin1_General_CS_AS;" -d "master"
sleep 10; $val++; Write-Host Waiting ... $val; if($val -ge 10) {break}
}

test_script:
- tox -e coverage-%adapter%

after_test:
- codecov
- codecov
16 changes: 9 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os, shutil
import os
import shutil
import sys

on_rtd = os.environ.get("READTHEDOCS", None) == "True"

Expand Down Expand Up @@ -56,8 +58,8 @@
master_doc = "index"

# General information about the project.
project = u"pyDAL"
copyright = u"2014, web2py-developers"
project = "pyDAL"
copyright = "2014, web2py-developers"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -188,7 +190,7 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
("index", "pydal.tex", u"pyDAL Documentation", u"web2py-developers", "manual"),
("index", "pydal.tex", "pyDAL Documentation", "web2py-developers", "manual"),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -216,7 +218,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [("index", "pyDAL", u"pyDAL Documentation", [u"web2py-developers"], 1)]
man_pages = [("index", "pyDAL", "pyDAL Documentation", ["web2py-developers"], 1)]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand All @@ -231,8 +233,8 @@
(
"index",
"pyDAL",
u"pyDAL Documentation",
u"web2py-developers",
"pyDAL Documentation",
"web2py-developers",
"pyDAL",
"pyDAL",
"Miscellaneous",
Expand Down
7 changes: 4 additions & 3 deletions pydal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
__version__ = "20210215.1"
__version__ = "20250922.1"

from .base import DAL
from .objects import Field
from .helpers.classes import SQLCustomType
from .helpers.methods import geoPoint, geoLine, geoPolygon
from .helpers.methods import geoLine, geoPoint, geoPolygon
from .objects import Field
from .querybuilder import QueryBuilder
Loading