Skip to content
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ stmt = pyrsql.PageRequest.of(0, 25).apply(stmt, User, orm=orm)
### Sort

- Multi-field: `name,asc;company.name,desc,ic`
- Ignore-case modifier (`ic`)
- Ignore-case modifier (`ic` or `ignorecase`)
- Function selectors: `@upper[name],asc`

### Pagination
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ markers. Use `=in=(*)` to match a literal asterisk.
|----------|---------|-------------|
| `asc` | `name,asc` | Ascending (default) |
| `desc` | `name,desc` | Descending |
| `ic` | `name,desc,ic` | Ignore case |
| `ic`, `ignorecase` | `name,desc,ic` | Ignore case |
1 change: 1 addition & 0 deletions docs/usage/sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Sort.parse("name,asc;company.name,desc")

```python
Sort.parse("name,desc,ic") # case-insensitive descending
Sort.parse("name,desc,ignorecase") # same modifier, spelled out
```

## Function selectors
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pyrsql"
version = "0.0.5"
version = "0.0.6"
description = "Compiler-oriented RSQL query engine for safe, typed, and extensible Python ORM-backed APIs."
readme = "README.md"
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion src/pyrsql/sorting/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def _parse_ignore_case(
SortParseError: If the modifier is unsupported.
"""
match raw_flag.strip().lower():
case "ic":
case "ic" | "ignorecase":
return True
case _:
raise SortParseError(
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/sorting/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
True,
id="direction-and-ignore-case",
),
pytest.param(
"company.name,desc,ignorecase",
"company.name",
SortDirection.DESCENDING,
True,
id="direction-and-ignorecase-alias",
),
pytest.param(
" company.name , desc , ic ",
"company.name",
Expand Down
Loading