1.6.0 • Published 2 years ago
@claroscuro/this-is-a-test-987 v1.6.0
OQLBuilder Library
Introduction
OQLBuilder is a flexible library designed to simplify the construction of Object Query Language (OQL) queries. It aims to reduce the complexity of writing long queries, prevent syntax errors, and make code more maintainable and testable.
Features
- Handles various comparison operators like
contains,equals,greaterThan, etc. - Support for logical operators
ANDandOR. - Escapes values to prevent OQL injection.
- Extensible for future enhancements.
Installation
npm install @company/OQL-BuilderUsage
Here's a quick example to get you started:
import { OQLBuilder } from '@company/OQL-Builder';
const query = OQLBuilder.create()
.equals({ column: "column1", value: "value1" })
.contains({ column: "column2", value: "value2", logicalOperator: "OR })
.in({column: "column3, value: ["value3", "value4"]}})
.build();
console.log(query); // column1 EQUALS "value1" AND column2 CONTAINS "value2" OR column3 IN ("value3", "value4")API Reference
create()
Initializes a new instance of the query builder.
equals({ column, value }, options?)
Adds an 'equals' condition to the query.
contains({ column, value }, options?)
Adds a 'contains' condition to the query.
Advanced Usage
Grouping Conditions
const subQuery = OQLBuilder.create()
.equals({ column: "subColumn", value: "subValue" })
.build();
const query = OQLBuilder.create()
.createGroup(() => subQuery)
.build();Development
- Clone the repository
git clone- Install dependencies
npm installContributing
- Create a new branch
- Make and Commit your changes
- Run
npx changesetto generate a new changeset and version bump - Push your changes and open a pull request
- Once approved, merge your changes to
mainand delete your branch - A new PR will be created automatically to merge
your_branchintomain - Once merged, the new version will be published to NPM
1.6.0
2 years ago
1.5.2
2 years ago
1.5.1
2 years ago
1.5.0
2 years ago
1.4.1
2 years ago
1.4.0
2 years ago
1.3.1
2 years ago
1.2.2
2 years ago
1.3.0
2 years ago
1.2.0
2 years ago
1.1.9
2 years ago
1.2.1
2 years ago
1.1.8
2 years ago
1.1.7
2 years ago
1.1.6
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.0
2 years ago