Skip to content

Commit

Permalink
Fix cross compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
calvinlfer committed Oct 24, 2023
1 parent b9bcabf commit 7a7e242
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package io.kaizensolutions.virgil.models

trait MusicLibraryItemInstances {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package io.kaizensolutions.virgil.models

import io.kaizensolutions.virgil.codecs.CqlRowDecoder

trait MusicLibraryItemInstances:
given cqlRowDecoderForMusicLibraryItem: CqlRowDecoder.Object[MusicLibraryItem] =
CqlRowDecoder.derive[MusicLibraryItem]
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.kaizensolutions.virgil.models

import io.kaizensolutions.virgil.annotations.CqlColumn
import java.time.LocalDate

final case class MusicLibraryItem(
@CqlColumn(MusicLibraryItem.ArtistName) artistName: String,
@CqlColumn(MusicLibraryItem.AlbumName) albumName: String,
@CqlColumn(MusicLibraryItem.SongTitle) songTitle: String,
@CqlColumn(MusicLibraryItem.ReleaseDate) releaseDate: LocalDate,
@CqlColumn(MusicLibraryItem.Genre) genre: String,
@CqlColumn(MusicLibraryItem.DurationSeconds) durationSeconds: Int
)
object MusicLibraryItem extends MusicLibraryItemInstances {
val tableName = "selectspec_musiclibrary"
val ArtistName = "artist_name"
val AlbumName = "album_name"
val SongTitle = "song_title"
val ReleaseDate = "release_date"
val Genre = "genre"
val DurationSeconds = "duration_seconds"
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package io.kaizensolutions.virgil

import io.kaizensolutions.virgil.models.MusicLibraryItem
import io.kaizensolutions.virgil.cql._
import io.kaizensolutions.virgil.dsl._
import zio.test._
import io.kaizensolutions.virgil.dsl.SelectBuilder
import com.datastax.oss.driver.api.core.cql.Row
import java.time.LocalDate
import io.kaizensolutions.virgil.annotations.CqlColumn
import io.kaizensolutions.virgil.codecs.CqlRowDecoder
import zio.{Chunk, RIO}

Expand Down Expand Up @@ -135,21 +134,3 @@ object SelectBuilderSpec {
)
}
}

final case class MusicLibraryItem(
@CqlColumn(MusicLibraryItem.ArtistName) artistName: String,
@CqlColumn(MusicLibraryItem.AlbumName) albumName: String,
@CqlColumn(MusicLibraryItem.SongTitle) songTitle: String,
@CqlColumn(MusicLibraryItem.ReleaseDate) releaseDate: LocalDate,
@CqlColumn(MusicLibraryItem.Genre) genre: String,
@CqlColumn(MusicLibraryItem.DurationSeconds) durationSeconds: Int
)
object MusicLibraryItem {
val tableName = "selectspec_musiclibrary"
val ArtistName = "artist_name"
val AlbumName = "album_name"
val SongTitle = "song_title"
val ReleaseDate = "release_date"
val Genre = "genre"
val DurationSeconds = "duration_seconds"
}

0 comments on commit 7a7e242

Please sign in to comment.