ldbc v0.3.0-beta11 is released.
This release includes new feature additions, enhancements to existing features, disruptive changes and much more.
Note
ldbc is pre-1.0 software and is still undergoing active development. New versions are not binary compatible with prior versions, although in most cases user code will be source compatible.
The major version will be the stable version.
What's Changed
Adding DataType Column
If a column was to be given a data type or other setting, it had to be passed as an argument.
With this correction, it is now possible to define columns with data type characteristics.
In this method of definition, the column name can be used as the variable name, so it is no longer necessary to pass the column name as an argument.
class EntityTable extends Table[Entity]("entity"):
- def c1: Column[Long] = column[Long]("ci", BIGINT, AUTO_INCREMENT)
+ def c1: Column[Long] = bigint().autoIncrement
Column names can change their format by implicitly passing Naming.
The default is CamelCase, but to change this to PascalCase, do the following
class EntityTable extends Table[Entity]("entity"):
given Naming = Naming.PASCAL
def c1: Column[Long] = bigint().autoIncrement
If you want to change the format of a particular column, you can still define it by passing the column name as an argument.
class EntityTable extends Table[Entity]("entity"):
given Naming = Naming.PASCAL
def c1: Column[Long] = bigint().autoIncrement
def c2: Column[Long] = bigint("c_2")
Adding DDL Schema
Add schema function to perform DDL.
class UserTable extends Table[User]("user"):
def id: Column[Long] = bigint().autoIncrement.primaryKey
def name: Column[String] = varchar(255)
def age: Column[Option[Int]] = int()
override def * : Column[User] = (id *: name *: age).to[User]
val userTable = TableQuery[UserTable]
connection
.use { conn =>
DBIO
.sequence(
userTable.schema.create,
userTable.schema.createIfNotExists,
userTable.schema.dropIfExists,
userTable.schema.create
)
.commit(conn)
}
Schema can also be composed with other Schemas.
userTable.schema ++ userProfileTable.schema
SQL executable statements can be checked with the statements method.
userTable.schema.create.statements.foreach(println)
userTable.schema.createIfNotExists.statements.foreach(println)
userTable.schema.drop.statements.foreach(println)
userTable.schema.dropIfExists.statements.foreach(println)
userTable.schema.truncate.statements.foreach(println)
Performance Improvement
The change was made because the method of splitting using splitAt was faster than using the helper functions provided by scodec.
Before
After
💪 Enhancement
- Enhancement/2025 01 survey performance by @takapi327 in #380
- Enhancement/2025 02 data type column by @takapi327 in #388
- Enhancement/2025 02 added ddl schema by @takapi327 in #389
- Enhancement/2025 02 added key by @takapi327 in #390
🪲 Bug Fixes
- Comparison operator compile error due to use of Opaque Type Alias by @takapi327 in #357
- Empty VALUES in INSERT statement causes error statement to be issued by @takapi327 in #362
- Passing an empty value in the IN clause of a WHERE statement throws an error by @takapi327 in #364
- Fixed a bug that caused incorrect statements to be issued when keys w… by @takapi327 in #392
🔧 Refactoring
- Update bug report template by @takapi327 in #358
- Changed to use export function instead of creating Alias Type. by @takapi327 in #372
- refactor(connector): use hashing from fs2 by @i10416 in #368
- tidy: use effect aware uuid gen by @i10416 in #373
- tidy: use weaker effect constraints by @i10416 in #374
- Fixed ResultSetImpl get value logic by @takapi327 in #381
- Enclose columns in bag quotation marks by @takapi327 in #385
- Refactor/2025 02 key settings by @takapi327 in #387
⛓️ Dependency update
- Update sbt-scalajs, scalajs-library_2.13, ... from 1.17.0 to 1.18.1 by @scala-steward in #361
- Update sbt-typelevel, sbt-typelevel-site from 0.7.5 to 0.7.6 by @scala-steward in #367
- Update scalafmt-core from 3.8.3 to 3.8.6 by @scala-steward in #376
- Update sbt-typelevel, sbt-typelevel-site from 0.7.6 to 0.7.7 by @scala-steward in #377
- Update scala3-compiler, scala3-library, ... from 3.6.2 to 3.6.3 by @scala-steward in #370
- Update scala3-compiler, scala3-library, ... from 3.3.4 to 3.3.5 by @scala-steward in #382
- Update sbt-scalajs, scalajs-library_2.13, ... from 1.18.1 to 1.18.2 by @scala-steward in #375
- Update doobie-core from 1.0.0-RC6 to 1.0.0-RC7 by @scala-steward in #386
- Update scalafmt-core from 3.8.6 to 3.9.0 by @scala-steward in #391
New Contributors
New @i10416 contributor. Thanks!
Full Changelog: v0.3.0-beta10...v0.3.0-beta11