If I understand it correctly this is not possible for now in automatic way. If one is not afraid, this can be done this way. Obtaining the id of last insert (per each master record insertion):
Then using it in SQ:
This code shows the MySql way. I'm posting it to the list for posterity's sake.
val scopeIdentity = SimpleFunction.nullaryLong
val inserted = Actions.insert( "cat", "eats", "dog)
//Print out the count of inserted records. println(inserted )
//Print out the primary key for the last inserted record. println(Query(scopeIdentity).first)
But since for auto incremented fields you have to use projections excluding autoinc fields, and then inserting tuples instead of named record types, there is a question if it is not worth to hold breath until SQ will support this directly.
Note I am SQ newbie, I might just misinform you.
- How to insert autoincremented master/slave records using ScalaQuery?
- How to read records in JSON format from Kafka using Structured Streaming?
- How to use ScalaQuery to insert a BLOB field?
- In Slick 3, how does one SQL-Compile an insert using a mapped case class?
- Exception when insert records into 3 tables within transaction using slick-plain SQL for play2
- How to insert a data into RDB (MySQL) using Spark?
- How do I group records that are within a specific time interval using Spark Scala or sql?
- How to set array of records Using GenericRecordBuilder
- How to fetch records from the database using Play with Scala and Slick
- How can you perform a Insert overwrite using Spark?
- how do i insert data into my H2 database using a form
- How to insert rows into cassandra if they don't exist using spark- cassandra driver?
- How to insert TIMESTAMP WITH TIME ZONE into HSQLDB using JOOQ
- How to insert an Image data int mySql mediumtext field using java/scala?
- How to insert a record having foregin key using slick 3?
- How to insert an empty object into JSON using Circe?
- How to return boolean if column contains integer value instead of searching millions of records using spark dataframe
- How to insert into MongoDB from actor using Casbah?
- how to insert data into database using play framework and scala
- How to change Datatypes of records inserting into Cassandra using Foreach Spark Structure streaming
- Scala, SQL Server - How to insert the current timestamp as datetime in SQL server using Scala?
- sql bulk insert never completes for 10 million records when using df.bulkCopyToSqlDB on databricks
- How can I limit my query by date using ScalaQuery
- How to calculate difference of time between two records using Scala?
- How to insert a linked object using Doobie
- How do I insert JSON into a postgres table using Anorm?
- How to create keyspace and insert data using Phantom dsl
- How to insert the record that has a foreign key using lifted embedded syntax on slick
- Scala: How to transform a POJO like object into a SQL insert statement using Scala reflection
- How to insert documents into a Mongo Time Series collection using scala driver
More Query from same tag
- Applying multiple map functions to streaming database results in Play 2.6
- Scala Guava type mismatch issue
- How to merge two columns into a new DataFrame?
- Stop the fs2-stream after a timeout
- Parsing XML with multiple, identical tags
- Sbt script and different resources and source directories
- How to fetch a value from build.sbt in terminal
- How to make Scala's type system catch this MatchError?
- Flink : WordCount example throws ClassNotFoundException
- Play Iteratee throttling
- Core calculus in scala type system (recursion)
- How to throw the exceptions when reading from the directory?
- How to save a Map result to a text file in Spark scala?
- Scala-java.lang.ArrayIndexOutOfBoundsException: 1
- why an action takes multiple jobs to get completed in spark - scala
- Inserting Data Into Cassandra table Using Spark DataFrame
- Scala pattern match multiple types
- Error while loading class when using Stanford Topic Modeling Toolkit (TMT)
- Could not find implicit Marshaller in Spray.io when using Jackson
- Flatten Parquet File with nested Arrays and StructType Spark Scala
- why is scala actors deprecated in 2.10?
- Scala MongoDB Chaining Methods
- Interactive debug console for scala in Intellij?
- Removing MongoDB Object ID when fetching results from a collection
- Nested GroupBy & Aggregation in Scala
- Running a Scala script outside of its directory with classpath
- Elegant grouping of implicit value classes
- IntelliJ Scala SBT scala.slick package not found
- Could not find or load main class com.weekdays.claobj.Ann1
- Explain why import scala.Predef.String fails build