https://github.com/fullstackplayer/fsp.jexecutor
A JBDAP executor written in TypeScript, compatible with both Nodejs and Deno.
https://github.com/fullstackplayer/fsp.jexecutor
Last synced: about 1 year ago
JSON representation
A JBDAP executor written in TypeScript, compatible with both Nodejs and Deno.
- Host: GitHub
- URL: https://github.com/fullstackplayer/fsp.jexecutor
- Owner: FullStackPlayer
- License: gpl-3.0
- Created: 2021-12-24T09:20:41.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-24T14:03:31.000Z (over 4 years ago)
- Last Synced: 2025-02-17T12:45:47.733Z (over 1 year ago)
- Language: TypeScript
- Size: 92.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fsp.JExecutor
A JBDAP executor written in TypeScript, compatible with both Nodejs and Deno.
This is only a general wrapper, an adapter suits your own data source is required. We will provide an official MySQL adapter, take it to be an adapter example.
## Usage
~~~ts
import { JExecutor, JConfig, JRequest, SecurityMode, IJAdapter, AdapterStatus } from "../../mod.ts";
// adpt should be an instance of an adapter which implements IJAdapter
// here we just define an IJAdapter compatible object for demo purpose
let adpt: IJAdapter = {
client: {},
config: {},
status: AdapterStatus.UNSET,
logs:[],
async connect() {},
async process(req: JRequest, cfg: JConfig) {
return req
}
}
let exe = new JExecutor(adpt)
let request = new JRequest({
commands: [
{
name: 'users',
type: 'list',
target: 'User',
fields: `id,lastName=>name`
}
]
})
let res = await exe.execute(request)
~~~