Skip to content

Add the Snapshot action (attempt #3)#202

Merged
comnik merged 6 commits intomainfrom
ncg-snapshot-action-3
Feb 18, 2026
Merged

Add the Snapshot action (attempt #3)#202
comnik merged 6 commits intomainfrom
ncg-snapshot-action-3

Conversation

@comnik
Copy link
Collaborator

@comnik comnik commented Feb 17, 2026

// Demand the source IDB, take an immutable snapshot, and turn it into an EDB
// under the given path.
message Snapshot {
  repeated string destination_path = 1;
  RelationId source_relation = 2;
}

@comnik comnik self-assigned this Feb 17, 2026
@comnik comnik marked this pull request as ready for review February 17, 2026 12:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new Snapshot write action to the Logical Query Protocol, allowing users to capture an immutable snapshot of an IDB (Intensional Database) and turn it into an EDB (Extensional Database) under a specified path. This is the third attempt at implementing this feature.

Changes:

  • Added Snapshot message to the protobuf specification with destination_path (repeated string) and source_relation (RelationId) fields
  • Updated all three SDK language bindings (Python, Go, Julia) with generated protobuf code
  • Extended the grammar to parse and pretty-print snapshot syntax: (snapshot ["path" "elements"] :relation_id)
  • Added comprehensive test coverage demonstrating single and multi-element paths with various source relation types

Reviewed changes

Copilot reviewed 11 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
proto/relationalai/lqp/v1/transactions.proto Added Snapshot message definition to Write oneof (field 5, using reserved field 4 was avoided)
sdks/python/src/lqp/proto/v1/transactions_pb2.pyi Python type stubs for Snapshot message
sdks/python/src/lqp/proto/v1/transactions_pb2.py Python generated protobuf code for Snapshot
sdks/go/src/lqp/v1/transactions.pb.go Go generated protobuf code with Snapshot message and getter methods
sdks/go/src/print.go Added pretty-printing support for snapshot action using BRACKET for paths
sdks/julia/LogicalQueryProtocol/src/gen/relationalai/lqp/v1/*.jl Julia generated protobuf code with Snapshot struct and encode/decode functions
meta/src/meta/grammar.y Added snapshot grammar rule with construct/deconstruct for parsing and printing
tests/lqp/snapshot.lqp Test demonstrating snapshot functionality with minimal formatting
tests/pretty/snapshot.lqp Test with expanded/pretty-printed format including configure block
tests/bin/snapshot.bin Binary representation of the test transaction

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@staworko staworko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. A couple of minor cosmetic suggestions.

# Autogenerated using ProtoBuf.jl v1.2.0 on 2026-02-09T13:12:21.246
# original file: /Users/nystrom/rai/nn-meta-12-go-tools/proto/relationalai/lqp/v1/logic.proto (proto3 syntax)
# Autogenerated using ProtoBuf.jl v1.2.0 on 2026-02-17T13:30:36.950
# original file: /Users/niko/Projects/logical-query-protocol/proto/relationalai/lqp/v1/logic.proto (proto3 syntax)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove logic_pb.jl and and fragments_pb.jl from the diff for clarity?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually let me file a PR against ProtoBuf.jl to stop including this information...

;; Define the EDBs we're going to be referring to.
(define
(fragment :snapshots
(rel_edb :snapshot1 ["my_edb"] [])
Copy link
Contributor

@minsungc minsungc Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we swap the fields of snapshot to be consistent with rel_edb?

I can see an argument against (in rel_edb we are "reading from" an edb and in snapshot we are "writing to" and edb), and it's not blocking, but asking anyway.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was intended to reflect the read/write 🤔

Copy link
Contributor

@minsungc minsungc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promotion time ⤴️

@comnik comnik merged commit 0243928 into main Feb 18, 2026
6 checks passed
@comnik comnik deleted the ncg-snapshot-action-3 branch February 18, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments