Skip to content

Commit

Permalink
[api] Add new search variant to PHP client api #1287 (#1288)
Browse files Browse the repository at this point in the history
* update tests

* add search to query builder

* fix coverage

* change ts api client

* Update main.ts

* Update typescript.en-US.mdx

* Update package-lock.json

* linting errors

* php api

* lint

* Update index.php

* Update php.en-US.mdx

* Update index.php

* formatting

* Update QueryBuilder.php

* add more test queries

* Update query.test.ts

* Update index.php
  • Loading branch information
michaelvlach authored Sep 27, 2024
1 parent 62e89cf commit c29cc85
Show file tree
Hide file tree
Showing 9 changed files with 818 additions and 304 deletions.
14 changes: 14 additions & 0 deletions agdb/src/db/db_key_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ impl<const N: usize> From<[DbKeyOrder; N]> for DbKeyOrders {
}
}

impl From<DbKeyOrder> for DbKeyOrders {
fn from(value: DbKeyOrder) -> Self {
Self(vec![value])
}
}

impl From<&DbKeyOrder> for DbKeyOrders {
fn from(value: &DbKeyOrder) -> Self {
Self(vec![value.clone()])
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down Expand Up @@ -63,5 +75,7 @@ mod tests {
let _orders = DbKeyOrders::from(vec![DbKeyOrder::Asc(1.into())]);
let _orders = DbKeyOrders::from([DbKeyOrder::Asc(1.into())].as_slice());
let _orders = DbKeyOrders::from([DbKeyOrder::Asc(1.into())]);
let _orders = DbKeyOrders::from(DbKeyOrder::Asc(1.into()));
let _orders = DbKeyOrders::from(&DbKeyOrder::Asc(1.into()));
}
}
2 changes: 1 addition & 1 deletion agdb_api/php/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ elif [[ "$1" == "openapi" ]]; then
elif [[ "$1" == "test_queries" ]]; then
test_queries
else
echo "Usage: $0 [coverage|analysis|format|format:check|openapi|test_queries]"
echo "Usage: $0 [coverage|analyse|format|format:check|openapi|test_queries]"
exit 1
fi
Loading

0 comments on commit c29cc85

Please sign in to comment.