1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use SchemaBlock;
use Error as ParseError;
extern crate derive_more;
extern crate pest_derive;
extern crate alloc;
pub
pub
pub
use *;
pub use parse as parse_dbml_unchecked;
/// Default database schema if not specified in a DBML file.
pub const DEFAULT_SCHEMA: &str = "public";
/// Parses the given text input and performs a semantics check.
///
/// # Arguments
///
/// * `input` - A reference to a string containing the text content to be parsed.
///
/// # Returns
///
/// Returns a `Result` where:
/// - If parsing and semantic analysis are successful, it contains the resulting `analyzer::SemanticSchemaBlock`.
/// - If an error occurs during parsing or analysis, it contains a `ParseError` indicating the specific issue.
///
/// # Examples
///
/// ```rs
/// use your_crate_name::{parse_dbml, ParseError};
///
/// let content = "example content";
/// match parse_dbml(content) {
/// Ok(sem_ast) => {
/// // Successfully parsed and analyzed content.
/// // Work with the semantic analysis result (sem_ast) here.
/// }
/// Err(parse_error) => {
/// // Handle the parsing error.
/// eprintln!("Parsing error: {:?}", parse_error);
/// }
/// }
/// ```