Skip to content

Support the _databaseId variable in sql template #152

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

Merged
merged 5 commits into from
Jun 20, 2023

Conversation

naka-sho
Copy link
Contributor

use of databaseId

discription

_databaseId not available in default FreemarkerLanguageDriver.

Fix preProcessDataContext.

Add _databaseId to dataContext.

Convert _databaseId before executing SQL.

error detail

freemarker.core.InvalidReferenceException: The following has
evaluated to null or missing:
==>_databaseId  [in nameless template at line 4, column 21]

@naka-sho naka-sho mentioned this pull request Jun 14, 2023
@kazuki43zoo
Copy link
Member

@naka-sho
Thanks for your contributing!! Could you add test cases for this changes? If you cannot add test cases, I will add these and merge this PR!!

@kazuki43zoo kazuki43zoo self-assigned this Jun 18, 2023
@kazuki43zoo kazuki43zoo added this to the 1.2.5 milestone Jun 18, 2023
@kazuki43zoo kazuki43zoo added enhancement waiting for feedback Waiting for feedback from contributors labels Jun 18, 2023
@kazuki43zoo kazuki43zoo changed the title use of databaseId Support the _databaseId variable in sql template Jun 18, 2023
@naka-sho
Copy link
Contributor Author

@kazuki43zoo
thank you.
I have prepared a simple test case.
If datbaseId is set, you can get one record.
Please check.

Copy link
Member

@kazuki43zoo kazuki43zoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@naka-sho Thanks for your great working! I add trivial comments.

@naka-sho naka-sho requested a review from kazuki43zoo June 20, 2023 14:40
@naka-sho
Copy link
Contributor Author

@kazuki43zoo
thank you.
Please re check.

@coveralls
Copy link

Coverage Status

coverage: 93.561% (+0.1%) from 93.462% when pulling 0b39e57 on naka-sho:feature/use-of-database-id into 2c43adb on mybatis:master.

@kazuki43zoo kazuki43zoo removed the waiting for feedback Waiting for feedback from contributors label Jun 20, 2023
@kazuki43zoo kazuki43zoo merged commit bba971c into mybatis:master Jun 20, 2023
kazuki43zoo added a commit to kazuki43zoo/freemarker-scripting that referenced this pull request Jun 20, 2023
@kazuki43zoo kazuki43zoo mentioned this pull request Jun 20, 2023
kazuki43zoo added a commit that referenced this pull request Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants