-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add @Statement
macro
#60
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #60 +/- ##
==========================================
+ Coverage 84.88% 87.62% +2.74%
==========================================
Files 155 146 -9
Lines 21496 20271 -1225
==========================================
- Hits 18246 17763 -483
+ Misses 3250 2508 -742
Flags with carried forward coverage won't be shown. Click here to find out more.
|
How I import OracleNIOMacros in swift? I have never worked with macros before |
Currently you have to go to your dependencies: [
.package(url: "https://github.com/lovetodream/oracle-nio.git", branch: "statement-macro")
],
targets: [
.target(
name: "PostgresNIOMacros",
dependencies: [
...
.product(name: "OracleNIO", package: "oracle-nio")
.product(name: "OracleNIOMacros", package: "oracle-nio")
]
)
] Then you can use OracleNIOMacros as you would use anything else, just import it on the top of your file.
|
Is there an example Project anywhere ? |
Not yet, it is still subject to change |
Declaration
This adds a protocol
OraclePreparedStatement
, to allow creating and executing SQL statements in a structured way.Declare using Macro
Furthermore it allows us to create these using a powerful
@Statement
macro.Macros are not part of the
OracleNIO
module, theOracleNIOMacros
module has to be imported by the caller.The same code as the one above can be created using two lines of code.
The macro adds even more convenience, it expands to the following code:
Querying
The statement can now be used similar to normal
OracleStatement
s.