Skip to content

Commit

Permalink
CASL-391 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Amaneusz committed Aug 29, 2024
1 parent 94f076b commit 4987fb4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ open class PgSession(
when (request) {
is WriteRequest -> {
saveTransactionIntoDb(true) // with transaction start time
//TODO(Kuba): PgWriter wciska Xyz
val response = PgWriter(this, request).execute()
saveTransactionIntoDb() // with updated counts
return response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
//
//import naksha.model.*
//import naksha.model.NakshaError.NakshaErrorCompanion.ILLEGAL_STATE
//import naksha.model.objects.NakshaCollection
//import naksha.model.objects.NakshaFeature
//import naksha.model.request.query.TupleColumn.TupleColumn_C.flags
//import naksha.psql.*
//import kotlin.jvm.JvmField
//
//open class RowUpdater(
//open class MetadataFactory(
// /**
// * The session to which this writer is linked.
// */
Expand All @@ -20,24 +20,24 @@
// * @param feature the feature to insert.
// * @return the metadata for this operation.
// */
// fun xyzInsert(collection: PgCollection, feature: NakshaFeature): Metadata {
// fun metadataForInsert(tupleNumber: TupleNumber): Metadata {
// val version = session.version()
// val versionTime = session.versionTime()
//// return Metadata(
//// createdAt = versionTime,
//// updatedAt = versionTime,
//// authorTs = versionTime,
//// version = version.txn,
//// uid = session.uid.getAndAdd(1),
//// hash = Metadata.hash(feature, session.options.excludePaths, session.options.excludeFn),
//// geoGrid = Metadata.geoGrid(feature),
//// flags = flags(collection.nakshaCollection),
//// appId = session.options.appId,
//// author = session.options.actor,
//// type = featureType(collection, feature),
//// origin = feature.properties.xyz.origin,
//// id = feature.id
//// )
// return Metadata(
// createdAt = versionTime,
// updatedAt = versionTime,
// authorTs = versionTime,
// version = version,
// uid = session.uid.getAndAdd(1),
// hash = Metadata.hash(feature, session.options.excludePaths, session.options.excludeFn),
// geoGrid = Metadata.geoGrid(feature),
// flags = flags(collection.nakshaCollection),
// appId = session.options.appId,
// author = session.options.actor,
// type = featureType(collection, feature),
// origin = feature.properties.xyz.origin,
// id = feature.id
// )
// TODO("Finish me!")
// }
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class PgWriter(
return collection
}

internal fun createCollection(map: PgMap, write: WriteExt): Tuple {
private fun createCollection(map: PgMap, write: WriteExt): Tuple {
// Note: write.collectionId is always naksha~collections!
val feature = write.feature?.proxy(NakshaCollection::class) ?: throw NakshaException(
ILLEGAL_ARGUMENT,
Expand Down Expand Up @@ -394,6 +394,8 @@ class PgWriter(
}

internal fun updateFeature(collection: PgCollection, write: WriteExt): Tuple {
val transaction = session.transaction()

TODO("Implement me")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class TestPsql {
assertTrue(naksha_transactions.exists(), "$VIRT_TRANSACTIONS should exist!")
}

// @Test
// @Test TODO: fix dropping
fun create_collection_and_drop_it() {
val col = NakshaCollection(randomString())
val writeRequest = WriteRequest()
Expand Down

0 comments on commit 4987fb4

Please sign in to comment.