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

postgresql plus string #1730

Closed
Hell-Innocence opened this issue Apr 24, 2023 · 1 comment · Fixed by #1958
Closed

postgresql plus string #1730

Hell-Innocence opened this issue Apr 24, 2023 · 1 comment · Fixed by #1958

Comments

@Hell-Innocence
Copy link

PlusOp is +
Postgresql plus string is ||

@shalaga44
Copy link

you can create your own custom operator

    /**
     * Represents an PostgreSQL operator that adds [expr2] to [expr1] in.
     */
    class PlusPostgreSqlOp(
        /** The left-hand side operand. */
        expr1: Expression<String>,
        /** The right-hand side operand. */
        expr2: Expression<String>,
        /** The column type of this expression. */
        columnType: IColumnType
    ) : CustomOperator<String>("||", columnType, expr1, expr2)

    /** Adds the [t] value to this expression. */
    infix operator fun ExpressionWithColumnType<String>.plus(t: String): PlusPostgreSqlOp = PlusPostgreSqlOp(this, QueryParameter(t, columnType), columnType)

    /** Adds the [other] expression to this expression. */
    infix operator fun ExpressionWithColumnType<String>.plus(other: Expression<String>): PlusPostgreSqlOp = PlusPostgreSqlOp(this, other, columnType)

@bog-walk bog-walk linked a pull request Jan 4, 2024 that will close this issue
@e5l e5l closed this as completed in #1958 Jan 5, 2024
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 a pull request may close this issue.

2 participants