Skip to content

Conversation

@ingarabr
Copy link
Contributor

@ingarabr ingarabr commented Apr 27, 2023

Add compile time validation of valid idents. This is a minimal effort and can be improved on later.

Migration:

  • Add the import: no.nrk.bigquery.syntax._
  • Replace Ident("my_value") with ident"my_value"

Example usage:

import no.nrk.bigquery.syntax._

val validIdent1 = ident"foo" // compiles
val validIdent2 = ident"foo.bar" // compiles
val invalidIdent = ident"4foos" // compile error

It's not expected that the strings we use should follow the
indent rules when it comes to how they crate BQ fragments.
@ingarabr ingarabr marked this pull request as ready for review April 27, 2023 08:56

import org.typelevel.literally.Literally

object syntax {
Copy link
Contributor

Choose a reason for hiding this comment

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

follow-up PR with moving interpolators and other syntax instances here.

@ingarabr ingarabr merged commit 1661ac5 into main Apr 27, 2023
@ingarabr ingarabr deleted the feature/ident-literally branch April 27, 2023 13:06
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.

3 participants