Skip to content
This repository has been archived by the owner on Mar 24, 2024. It is now read-only.

Oracle Support #2

Open
dmcghan opened this issue Sep 6, 2018 · 4 comments
Open

Oracle Support #2

dmcghan opened this issue Sep 6, 2018 · 4 comments

Comments

@dmcghan
Copy link

dmcghan commented Sep 6, 2018

Looks very cool! I'd love to see support for Oracle Database and bind variables.

@eejdoowad
Copy link
Collaborator

Is a free version of Oracle available?

The code is structure to support multiple database libraries. For now, I'm just working on getting Postgres production ready. If someone were to submit a PR supporting another databases, I would accept it.

@dmcghan
Copy link
Author

dmcghan commented Sep 6, 2018

@eejdoowad

Is a free version of Oracle available?

There is, it's called Oracle XE. The current version is 11.2, but 18.? will hopefully be out in the near future.

For now, I'm just working on getting Postgres production ready.

Does Postgres use bind variables? If yes, do you support them - the examples didn't look like they did. Here's the last one:

// UPDATE
await Person({ id: 23 }).set({ name: 'Rob' })
// "update person where id = 23 set name = 'Rob'"

With bind variables, that might look like:

// UPDATE
await Person({ id: 23 }).set({ name: 'Rob' })
// "update person where id = :bind_1 set name =:bind_2"
// binds = [23,  'Rob']

If bind variables are supported, it should be easy to add support for other databases when that work is done.

@eejdoowad
Copy link
Collaborator

eejdoowad commented Sep 6, 2018

Yes, Sqorn parameterizes variables to prevent SQL injection, so it shouldn't be too difficult. For Postgres, this looks like:

await Person({ id: 23 }).set({ name: 'Rob' })
// { txt: 'update person set name = $1 where id = $2', arg: ['Rob', 23] }

@cemremengu
Copy link
Contributor

Nice! It would be great if you provide a short guideline on how to implement a new dialect after you finalize the structure.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants