-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(load): move datasources from dvmql to load dir
- Loading branch information
1 parent
a9ccd4e
commit d097b41
Showing
2 changed files
with
90 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,53 @@ | ||
pub mod edges; | ||
|
||
/// Enum representing the different types of datasources. | ||
#[derive(Debug, PartialEq)] | ||
pub enum Datasource { | ||
Csv(Csv), | ||
Xml(Xml), | ||
Excel(Excel), | ||
Database(Database), | ||
} | ||
|
||
/// CSV datasource | ||
#[derive(Debug, PartialEq)] | ||
pub struct Csv { | ||
pub id: u8, | ||
pub name: String, | ||
pub filename: String, | ||
pub path: String, | ||
pub delimiter: char, | ||
pub has_headers: bool, | ||
} | ||
|
||
/// XML datasource | ||
#[derive(Debug, PartialEq)] | ||
pub struct Xml { | ||
pub id: u8, | ||
pub name: String, | ||
pub filename: String, | ||
pub path: String, | ||
} | ||
|
||
/// Database datasource | ||
#[derive(Debug, PartialEq)] | ||
pub struct Database { | ||
pub id: u8, | ||
pub name: String, | ||
pub system: String, | ||
pub connection: String, | ||
pub username: String, | ||
pub password: String, | ||
pub database: String, | ||
} | ||
|
||
/// Excel datasource | ||
#[derive(Debug, PartialEq)] | ||
pub struct Excel { | ||
pub id: u8, | ||
pub name: String, | ||
pub filename: String, | ||
pub path: String, | ||
pub sheet: String, | ||
pub has_headers: bool, | ||
} |