Skip to content

Commit de30f1d

Browse files
committed
Cleanup.
1 parent 856593a commit de30f1d

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

crates/core/src/operations.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
use alloc::format;
2-
use alloc::string::{String, ToString};
2+
use alloc::string::String;
33

44
use crate::error::{PSResult, SQLiteError};
55
use sqlite_nostd as sqlite;
66
use sqlite_nostd::{Connection, ResultCode};
77

88
use crate::ext::SafeManagedStmt;
9-
use crate::util::*;
109

1110
// Run inside a transaction
1211
pub fn insert_operation(db: *mut sqlite::sqlite3, data: &str) -> Result<(), SQLiteError> {
@@ -145,7 +144,7 @@ INSERT OR IGNORE INTO ps_updated_rows(row_type, row_id) VALUES(?1, ?2)",
145144
}
146145
supersede_statement.reset()?;
147146

148-
if (op == "REMOVE") {
147+
if op == "REMOVE" {
149148
let should_skip_remove = !superseded;
150149

151150
add_checksum = add_checksum.wrapping_add(checksum);
@@ -251,13 +250,13 @@ WHERE bucket = ?1",
251250
Ok(())
252251
}
253252

254-
pub fn clear_remove_ops(db: *mut sqlite::sqlite3, _data: &str) -> Result<(), SQLiteError> {
253+
pub fn clear_remove_ops(_db: *mut sqlite::sqlite3, _data: &str) -> Result<(), SQLiteError> {
255254
// No-op
256255

257256
Ok(())
258257
}
259258

260-
pub fn delete_pending_buckets(db: *mut sqlite::sqlite3, _data: &str) -> Result<(), SQLiteError> {
259+
pub fn delete_pending_buckets(_db: *mut sqlite::sqlite3, _data: &str) -> Result<(), SQLiteError> {
261260
// No-op
262261

263262
Ok(())

crates/core/src/schema_management.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use sqlite_nostd::Context;
1313
use crate::error::{PSResult, SQLiteError};
1414
use crate::ext::ExtendedDatabase;
1515
use crate::util::{quote_identifier, quote_json_path};
16-
use crate::view_admin::powersync_init_impl;
1716
use crate::{create_auto_tx_function, create_sqlite_text_fn};
1817

1918
fn update_tables(db: *mut sqlite::sqlite3, schema: &str) -> Result<(), SQLiteError> {
@@ -303,8 +302,7 @@ fn powersync_replace_schema_impl(
303302
let db = ctx.db_handle();
304303

305304
// language=SQLite
306-
// db.exec_safe("SELECT powersync_init()").into_db_result(db)?;
307-
powersync_init_impl(ctx, args);
305+
db.exec_safe("SELECT powersync_init()").into_db_result(db)?;
308306

309307
update_tables(db, schema)?;
310308
update_indexes(db, schema)?;

crates/core/src/view_admin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ create_sqlite_text_fn!(
111111
"powersync_external_table_name"
112112
);
113113

114-
pub fn powersync_init_impl(
114+
fn powersync_init_impl(
115115
ctx: *mut sqlite::context,
116116
_args: &[*mut sqlite::value],
117117
) -> Result<String, SQLiteError> {

0 commit comments

Comments
 (0)