feat: port create_table to the async python API and the remote rust API (#1031)

I've also started `ASYNC_MIGRATION.MD` to keep track of the breaking
changes from sync to async python.
This commit is contained in:
Weston Pace
2024-02-29 13:29:29 -08:00
parent accf31fa92
commit 4299f719ec
29 changed files with 1406 additions and 53 deletions

View File

@@ -68,13 +68,17 @@ impl Table {
}
#[napi]
pub async fn count_rows(&self, filter: Option<String>) -> napi::Result<usize> {
self.table.count_rows(filter).await.map_err(|e| {
napi::Error::from_reason(format!(
"Failed to count rows in table {}: {}",
self.table, e
))
})
pub async fn count_rows(&self, filter: Option<String>) -> napi::Result<i64> {
self.table
.count_rows(filter)
.await
.map(|val| val as i64)
.map_err(|e| {
napi::Error::from_reason(format!(
"Failed to count rows in table {}: {}",
self.table, e
))
})
}
#[napi]