Skip to content

Commit

Permalink
test: update example to new api
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Dec 17, 2023
1 parent b44d385 commit f87b6aa
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions examples/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use pgwire::api::results::{
DataRowEncoder, DescribeResponse, FieldInfo, QueryResponse, Response, Tag,
};
use pgwire::api::stmt::NoopQueryParser;
use pgwire::api::store::MemPortalStore;
use pgwire::api::{ClientInfo, MakeHandler, Type};
use pgwire::error::{ErrorInfo, PgWireError, PgWireResult};
use pgwire::messages::data::DataRow;
Expand All @@ -22,7 +21,6 @@ use tokio::net::TcpListener;

pub struct SqliteBackend {
conn: Arc<Mutex<Connection>>,
portal_store: Arc<MemPortalStore<String>>,
query_parser: Arc<NoopQueryParser>,
}

Expand Down Expand Up @@ -190,13 +188,8 @@ fn get_params(portal: &Portal<String>) -> Vec<Box<dyn ToSql>> {
#[async_trait]
impl ExtendedQueryHandler for SqliteBackend {
type Statement = String;
type PortalStore = MemPortalStore<Self::Statement>;
type QueryParser = NoopQueryParser;

fn portal_store(&self) -> Arc<Self::PortalStore> {
self.portal_store.clone()
}

fn query_parser(&self) -> Arc<Self::QueryParser> {
self.query_parser.clone()
}
Expand Down Expand Up @@ -289,7 +282,6 @@ impl MakeHandler for MakeSqliteBackend {
fn make(&self) -> Self::Handler {
Arc::new(SqliteBackend {
conn: self.conn.clone(),
portal_store: Arc::new(MemPortalStore::new()),
query_parser: self.query_parser.clone(),
})
}
Expand Down

0 comments on commit f87b6aa

Please sign in to comment.