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

Support named parameters #2

Closed
thomasnield opened this issue Sep 10, 2017 · 0 comments
Closed

Support named parameters #2

thomasnield opened this issue Sep 10, 2017 · 0 comments

Comments

@thomasnield
Copy link
Owner

Example 1:

        conn.select("SELECT * FROM USER WHERE ID = :id AND FLAG = :flag")
                .setInt("id", 4)
                .setBoolean("flag", true)
                .toFlowable { it.getInt("ID") to it.getString("USERNAME") }
                .subscribe(::println)

Example 2:

        conn.select("SELECT * FROM USER WHERE ID = :id AND FLAG = :flag")
                .setParam("id", 4)
                .setParam("flag", true)
                .toFlowable { it.getInt("ID") to it.getString("USERNAME") }
                .subscribe(::println)

Example 3:

        conn.select("SELECT * FROM USER WHERE ID = :id AND FLAG = :flag")
                .setParams("id" to 4, "flag" to true)
                .toFlowable { it.getInt("ID") to it.getString("USERNAME") }
                .subscribe(::println)
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

No branches or pull requests

1 participant