use crate::database::{DatabaseConfig, DatabaseConnection};
use crate::error::{IoError, Result};
pub struct PostgreSQLConnection {
#[allow(dead_code)]
config: DatabaseConfig,
}
impl PostgreSQLConnection {
pub fn new(config: &DatabaseConfig) -> Result<Self> {
Ok(Self {
config: config.clone(),
})
}
}
impl DatabaseConnection for PostgreSQLConnection {
fn query(&self, _query: &crate::database::QueryBuilder) -> Result<crate::database::ResultSet> {
Err(IoError::UnsupportedFormat(
"PostgreSQL implementation pending".to_string(),
))
}
fn execute_sql(
&self,
_sql: &str,
_params: &[serde_json::Value],
) -> Result<crate::database::ResultSet> {
Err(IoError::UnsupportedFormat(
"PostgreSQL implementation pending".to_string(),
))
}
fn insert_array(
&self,
_table: &str,
_data: scirs2_core::ndarray::ArrayView2<f64>,
_columns: &[&str],
) -> Result<usize> {
Err(IoError::UnsupportedFormat(
"PostgreSQL implementation pending".to_string(),
))
}
fn create_table(&self, _table: &str, _schema: &crate::database::TableSchema) -> Result<()> {
Err(IoError::UnsupportedFormat(
"PostgreSQL implementation pending".to_string(),
))
}
fn table_exists(&self, _table: &str) -> Result<bool> {
Err(IoError::UnsupportedFormat(
"PostgreSQL implementation pending".to_string(),
))
}
fn get_schema(&self, _table: &str) -> Result<crate::database::TableSchema> {
Err(IoError::UnsupportedFormat(
"PostgreSQL implementation pending".to_string(),
))
}
}