Comments (7)
I agree, this is one of the problem I was trying to solve, to provide a way to notify that some query has been executed.
Cancel a query execution was implemented I removed later, but it is probably a good idea to have it.
This was a proof of concept, Iยดm working on a better API, but still nothing really usable.
The problem with permissions is not easy to solve using hooks because you need to pass some kind context with extra information, in this case the current user.
from sqlhooks.
Thanks. Why not keep it simple and let the calling app be responsible for security?
from sqlhooks.
Can you elaborate? or give me an example?
from sqlhooks.
I'm thinking the sqlhooks would simply be sql hooks. It would be up to the app to determine what to do with an sqlhook callback, including determining if the current user has access to do it. So going back to my original post, a use case might be to stop any query that contains "CREATE TABLE" for users that don't have that permission. The app would determine whether the current user has the permission to "CREATE TABLE".
from sqlhooks.
sounds good, if you could draft something that would be cool!
Thanks!
from sqlhooks.
@nkev I've been working on the new API, please take a look at v2
branch.
from sqlhooks.
will do
from sqlhooks.
Related Issues (20)
- Add Benchmarks
- Add Error handler
- Improve performance HOT 13
- Compose hook HOT 4
- Before+after hooks for prepare HOT 1
- Tag latest commit HOT 3
- Include Go version requirement in README HOT 3
- Issues with gorm HOT 3
- can't use transactions with sqlhooks HOT 6
- QueryerContext interface and prepared statements HOT 1
- Actual resulting query? HOT 9
- SQL commands inside hook methods HOT 1
- how to log sql when sql execute failed? HOT 9
- Run a linter in the CI HOT 2
- driver.ErrSkip error with sqlx HOT 4
- add sqlhooks on awesome-go
- [Discussion] onError hook error ignore HOT 4
- when using wraper driver, table name has Double quotes HOT 1
- How get the query's Result on After Hook? HOT 1
- runtime error: comparing uncomparable type mssql.Error HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlhooks.