diff --git a/docs/src/test/dialects.md b/docs/src/test/dialects.md new file mode 100644 index 00000000..a2212fcb --- /dev/null +++ b/docs/src/test/dialects.md @@ -0,0 +1,41 @@ +# SQL Dialects + +In FunSQL, properties and capabilities of a particular SQL dialect +are encapsulated in a `SQLDialect` object. + + using FunSQL: SQLDialect + +The desired dialect can be specified by name. + + postgresql_dialect = SQLDialect(:postgresql) + #-> SQLDialect(:postgresql) + + display(postgresql_dialect) + #-> SQLDialect(:postgresql) + +If necessary, the dialect can be customized. + + postgresql_odbc_dialect = SQLDialect(:postgresql, + variable_style = :positional, + variable_prefix = '?') + #-> SQLDialect(:postgresql, …) + + display(postgresql_odbc_dialect) + #-> SQLDialect(:postgresql, variable_style = :POSITIONAL, variable_prefix = '?') + +The default dialect does not correspond to any particular database server. + + default_dialect = SQLDialect() + #-> SQLDialect() + + display(default_dialect) + #-> SQLDialect() + +A completely custom dialect can be specified. + + my_dialect = SQLDialect(:my, identifier_quotes = ('<', '>')) + #-> SQLDialect(name = :my, …) + + display(my_dialect) + #-> SQLDialect(name = :my, identifier_quotes = ('<', '>')) + diff --git a/docs/src/test/index.md b/docs/src/test/index.md index bc1fd037..d46d87ed 100644 --- a/docs/src/test/index.md +++ b/docs/src/test/index.md @@ -3,6 +3,7 @@ ```@contents Pages = [ "clauses.md", + "dialects.md", "entities.md", "nodes.md", ]