Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
arch: arm64
- os: linux
runs-on: ubuntu-latest
arch: amd64
arch: x86_64

steps:
- name: Checkout code
Expand Down Expand Up @@ -96,8 +96,8 @@ jobs:
echo "GOARCH=amd64" >> $GITHUB_ENV
echo "CGO_ENABLED=1" >> $GITHUB_ENV

- name: Set build environment (Linux)
if: matrix.os == 'linux'
- name: Set build environment (Linux x86_64)
if: matrix.os == 'linux' && matrix.arch == 'x86_64'
run: |
echo "GOOS=linux" >> $GITHUB_ENV
echo "GOARCH=amd64" >> $GITHUB_ENV
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: |
sqlrsync-linux-amd64/sqlrsync-linux-amd64
sqlrsync-linux-x86_64/sqlrsync-linux-x86_64
sqlrsync-darwin-amd64/sqlrsync-darwin-amd64
sqlrsync-darwin-arm64/sqlrsync-darwin-arm64
sqlrsync-windows-amd64/sqlrsync-windows-amd64.exe
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ CLAUDE.md
**/CLAUDE.md

tmp/
client/sqlrsync
client/sqlrsync
client/sqlrsync_simple
17 changes: 10 additions & 7 deletions bridge/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,15 @@ func (c *Client) GetDatabaseInfo() (*DatabaseInfo, error) {
func (c *Client) RunPushSync(readFunc ReadFunc, writeFunc WriteFunc) error {
c.Logger.Info("Starting origin sync", zap.String("database", c.Config.DatabasePath))

if c.Config.DryRun {
fmt.Println("Running in dry-run mode")
return nil
}

// Store I/O functions for callbacks
c.ReadFunc = readFunc
c.WriteFunc = writeFunc

if c.Config.DryRun {
c.Logger.Info("Running in dry-run mode")
}

c.Logger.Debug("Calling C sqlite_rsync_run_origin")

// Run the origin synchronization via CGO bridge
Expand All @@ -102,7 +103,8 @@ func (c *Client) RunPullSync(readFunc ReadFunc, writeFunc WriteFunc) error {
c.WriteFunc = writeFunc

if c.Config.DryRun {
c.Logger.Info("Running in dry-run mode")
fmt.Println("Running in dry-run mode. We should not have gotten here.")
return nil
}

c.Logger.Debug("Calling C sqlite_rsync_run_replica")
Expand All @@ -120,12 +122,13 @@ func (c *Client) RunPullSync(readFunc ReadFunc, writeFunc WriteFunc) error {

// RunDirectSync runs direct local synchronization between two SQLite files
func (c *Client) RunDirectSync(replicaPath string) error {
c.Logger.Info("Starting direct local sync",
c.Logger.Info("Starting direct local sync",
zap.String("origin", c.Config.DatabasePath),
zap.String("replica", replicaPath))

if c.Config.DryRun {
c.Logger.Info("Running in dry-run mode")
fmt.Println("Running in dry-run mode. We should not have gotten here.")
return nil
}

verboseLevel := 0
Expand Down
Loading
Loading