@@ -50,17 +50,16 @@ public void saveAll(List<TitleAuthor> titleAuthors) {
5050 var structType = StructType .of (
5151 "id" , PrimitiveType .Int64 ,
5252 "title" , PrimitiveType .Text ,
53- "author" , PrimitiveType .Text ,
54- "created_at" , OptionalType . of ( PrimitiveType .Timestamp )
53+ "author" , OptionalType . of ( PrimitiveType .Text ) ,
54+ "created_at" , PrimitiveType .Timestamp
5555 );
5656
5757 var listIssues = Params .of ("$args" , ListType .of (structType ).newValue (
5858 titleAuthors .stream ().map (issue -> structType .newValue (
59- "id" , PrimitiveValue .newInt64 (ThreadLocalRandom .current ().nextInt ()),
59+ "id" , PrimitiveValue .newInt64 (ThreadLocalRandom .current ().nextLong ()),
6060 "title" , PrimitiveValue .newText (issue .title ()),
61- "author" , PrimitiveValue .newText (issue .author ()),
62- "created_at" , OptionalType .of (PrimitiveType .Timestamp )
63- .newValue (PrimitiveValue .newTimestamp (Instant .now ()))
61+ "author" , OptionalType .of (PrimitiveType .Text ).newValue (PrimitiveValue .newText (issue .author ())),
62+ "created_at" , PrimitiveValue .newTimestamp (Instant .now ())
6463 )).toList ()
6564 ));
6665
@@ -70,8 +69,8 @@ public void saveAll(List<TitleAuthor> titleAuthors) {
7069 DECLARE $args AS List<Struct<
7170 id: Int64,
7271 title: Text,
73- author: Text,
74- created_at: Timestamp?, -- тут знак вопроса означает, что в Timestamp может быть передан NULL
72+ author: Text?, -- тут знак вопроса означает, что в Timestamp может быть передан NULL
73+ created_at: Timestamp,
7574 >>;
7675
7776 UPSERT INTO issues
0 commit comments