Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[refactor] dao prepare #146

Merged
merged 6 commits into from
Apr 21, 2015
Merged

[refactor] dao prepare #146

merged 6 commits into from
Apr 21, 2015

Conversation

thibaultcha
Copy link
Member

This PR started as an improvement for developing #147, but it's also useful to fix #11. It's a small refactor, to avoid having to call :prepare every time a DAO is instantiated.

Changes:
Notes:
  • :prepare is still called in kong.lua when Kong starts, as a simple way of checking all statements are valid. :prepare might disappear in the future.
  • An improvement will be to prepare the Rate Limiting plugin statements so they are prepared before being inserted in batch statements. For now, they are batched as plain strings.

@thibaultcha thibaultcha changed the title Refactor/dao prepare [refactor] dao prepare Apr 19, 2015
squash of:

[WIP][refactor] trying to prepare statements on the go

[WIP][refactor] all queries prepared on the go

- running :prepare is now optional
- all daos (from plugins too) are using self._queries to reference
  queries that will then be prepared
- remove preparation in find_by_keys because _execute already prepares

[WIP][refactor] allow _queries to contain strings

fix: cache key differing because of stripping
:prepare might disappear in the future.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 67.52% when pulling 1947fc1 on refactor/dao-prepare into 86ddf6f on master.

thibaultcha added a commit that referenced this pull request Apr 21, 2015
@thibaultcha thibaultcha merged commit 092032e into master Apr 21, 2015
@thibaultcha thibaultcha deleted the refactor/dao-prepare branch April 21, 2015 23:18
ctranxuan pushed a commit to streamdataio/kong that referenced this pull request Aug 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When Cassandra is temporarily down make sure the connection is resumed
2 participants