scirs2_io/database/
mysql.rs1use crate::database::{DatabaseConfig, DatabaseConnection};
7use crate::error::{IoError, Result};
8
9pub struct MySQLConnection {
11 #[allow(dead_code)]
12 config: DatabaseConfig,
13}
14
15impl MySQLConnection {
16 pub fn new(config: &DatabaseConfig) -> Result<Self> {
18 Ok(Self {
19 config: config.clone(),
20 })
21 }
22}
23
24impl DatabaseConnection for MySQLConnection {
26 fn query(&self, _query: &crate::database::QueryBuilder) -> Result<crate::database::ResultSet> {
27 Err(IoError::UnsupportedFormat(
28 "MySQL implementation pending".to_string(),
29 ))
30 }
31
32 fn execute_sql(
33 &self,
34 _sql: &str,
35 _params: &[serde_json::Value],
36 ) -> Result<crate::database::ResultSet> {
37 Err(IoError::UnsupportedFormat(
38 "MySQL implementation pending".to_string(),
39 ))
40 }
41
42 fn insert_array(
43 &self,
44 _table: &str,
45 _data: scirs2_core::ndarray::ArrayView2<f64>,
46 _columns: &[&str],
47 ) -> Result<usize> {
48 Err(IoError::UnsupportedFormat(
49 "MySQL implementation pending".to_string(),
50 ))
51 }
52
53 fn create_table(&self, _table: &str, _schema: &crate::database::TableSchema) -> Result<()> {
54 Err(IoError::UnsupportedFormat(
55 "MySQL implementation pending".to_string(),
56 ))
57 }
58
59 fn table_exists(&self, _table: &str) -> Result<bool> {
60 Err(IoError::UnsupportedFormat(
61 "MySQL implementation pending".to_string(),
62 ))
63 }
64
65 fn get_schema(&self, _table: &str) -> Result<crate::database::TableSchema> {
66 Err(IoError::UnsupportedFormat(
67 "MySQL implementation pending".to_string(),
68 ))
69 }
70}