https://github.com/articulate/scim-filter-transpiler
Transpiles Tokenized SCIM Filter into SQL command
https://github.com/articulate/scim-filter-transpiler
Last synced: over 1 year ago
JSON representation
Transpiles Tokenized SCIM Filter into SQL command
- Host: GitHub
- URL: https://github.com/articulate/scim-filter-transpiler
- Owner: articulate
- Created: 2019-10-10T13:58:09.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-24T15:28:48.000Z (over 6 years ago)
- Last Synced: 2025-01-25T14:43:53.125Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 55
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SCIM Filter Transpiler
Transpiles Tokenized SCIM v2 Filter into a SQL command. It utilizes https://github.com/di-wu/scim-filter-parser to do the work of parsing a raw filter query parameter.
## Install
```
go get github.com/articulate/scim-filter-transpiler
```
## Usage
```go
import "github.com/articulate/scim-filter-transpiler"
parser := NewParser(
// Attribute map that tells us how to map our attribute names.
// Any missing path will be returned as is.
map[string]string{
"id": "users.id",
"username": "users.username",
"emails.value": "emails.value",
"emails": "emails.value",
"emails.type": "emails.type",
},
)
// Use ToSql if you already have a parsed filter.
query, params, _ := parser.ToSqlFromString(`userName eq "andy@example.com"`)
```