/docs/about/compatibility.md

https://github.com/tathougies/beam · Markdown · 423 lines · 418 code · 5 blank · 0 comment · 0 complexity · f7b8664f958dcdf1a716efa4a442b0c5 MD5 · raw file

Large files are truncated click here to view the full file

  1. Beam strives to cover the full breadth of the relevant SQL
  2. standards. In general, if there is something in a SQL standard that is
  3. not implemented in a generic manner in `beam-core`, feel free to file
  4. an issue requesting support. There are some features that beam
  5. purposefully omits because no major RDBMS implements them. For
  6. example, database-level assertions are not supported in any of the
  7. default beam backends, and thus are not supported by `beam-core`. If
  8. you have a need for these features, feel free to file an issue. Be
  9. sure to motivate your use case with examples and a testing strategy.
  10. The relevant SQL standards are SQL-92, SQL:1999, SQL:2003, SQL:2008,
  11. and SQL:2011. Because not all the standards are not publicly
  12. accessible, I've done my best to piece together features from various
  13. documents available online. I believe I've covered most of the common
  14. cases, but there may be pieces of functionality that are missing. File
  15. an issue if this is the case.
  16. The table below summarizes the features defined in each SQL standard and beam's
  17. support for them. FULL means beam supports everything in that feature. NONE
  18. means that there is no support for that feature, and none planned. N/A means
  19. that the feature only applies to RDBMSs, not the SQL language. WONTFIX means
  20. that the feature has been considered and willfully ignored. UNKNOWN means not
  21. enough investigation has gone into the feature to make a determination. TODO
  22. means the feature has not been implemented yet, but an implementation is
  23. planned.
  24. !!! tip "Tip"
  25. The 'TODO' items are a great way to contribute to beam!
  26. | Feature | Status | Notes |
  27. | :-------------------------------------------------------------- | :------: | :---------------------------------------------------------------------------------------- |
  28. | **B011 Embedded Ada** | NONE | |
  29. | **B012 Embedded C** | NONE | |
  30. | **B013 Embedded COBOL** | NONE | |
  31. | **B014 Embedded FORTRAN** | NONE | |
  32. | **B015 Embedded MUMPS** | NONE | |
  33. | **B016 Embedded Pascal** | NONE | |
  34. | **B017 Embedded PL/I** | NONE | |
  35. | **B021 Direct SQL** | NONE | |
  36. | **B031 Basic dynamic SQL** | NONE | |
  37. | **B032 Extended dynamic SQL** | NONE | |
  38. | **B033 Untyped SQL-invoked function arguments** | NONE | |
  39. | **B034 Dynamic specification of cursor attributes** | NONE | |
  40. | **B035 Non-extended descriptor names** | NONE | |
  41. | **B051 Enhanced execution rights** | NONE | |
  42. | **B111 Module language Ada** | NONE | |
  43. | **B112 Module language C** | NONE | |
  44. | **B113 Module language COBOL** | NONE | |
  45. | **B114 Module language Fortran** | NONE | |
  46. | **B115 Module language MUMPS** | NONE | |
  47. | **B116 Module language Pascal** | NONE | |
  48. | **B117 Module language PL/I** | NONE | |
  49. | **B121 Routine language Ada** | NONE | |
  50. | **B122 Routine language C** | NONE | |
  51. | **B123 Routine language COBOL** | NONE | |
  52. | **B124 Routine language Fortran** | NONE | |
  53. | **B125 Routine language MUMPS** | NONE | |
  54. | **B126 Routine language Pascal** | NONE | |
  55. | **B127 Routine language PL/I** | NONE | |
  56. | **B128 Routine language SQL** | NONE | |
  57. | **B211 Module language Ada: VARCHAR and NUMERIC support** | NONE | |
  58. | **B221 Routine language Ada: VARCHAR and NUMERIC support** | NONE | |
  59. | **E011 - Numeric data types** | | |
  60. | E011-01 INTEGER and SMALLINT data types | FULL | Use `Int32` for `INTEGER`, `Int16` for `SMALLINT` |
  61. | E011-02 REAL, DOUBLE PRECISION, FLOAT | FULL | Use `Double` and `Float` |
  62. | E011-03 DECIMAL and NUMERIC data types | FULL | Use `Scientific`. You can provide the database precision using `beam-migrate` |
  63. | E011-04 Arithmetic operators | FULL | Use the `Num` instance for `QGenExpr` |
  64. | E011-05 Numeric comparison | FULL | Use the `.` suffixed operators (i.e., `==.`, `/=.`, `<.`, etc) |
  65. | E011-06 Implicit casting among numeric data types | WONTFIX | Beam never implicitly casts. Use `cast_` |
  66. | **E021 Character string types** | | |
  67. | E021-01 CHARACTER data type | FULL | Use `Text`. Use `beam-migrate` to specify width |
  68. | E021-02 CHARACTER VARYING data type | FULL | Use `Text`. Use `beam-migrate` to specify width. |
  69. | E021-03 Character literals | FULL | Use `val_` |
  70. | E021-04 CHARACTER\_LENGTH function | FULL | Use `charLength_` |
  71. | E021-05 OCTET\_LENGTH function | FULL | Use `octetLength_` |
  72. | E021-06 SUBSTRING function | TODO | |
  73. | E021-07 Character concatenation | FULL | Use `concat_` |
  74. | E021-08 UPPER and LOWER functions | FULL | Use `upper_` and `lower_` |
  75. | E021-09 TRIM function | PARTIAL | Use `trim_`. Full support may be provided on backends that implement it |
  76. | E021-10 Implicit casting among string types | WONTFIX | Beam never implicitly casts. Use `cast_` |
  77. | E021-11 POSITION function | FULL | Use `position_` |
  78. | E021-12 Character comparison | FULL | Use comparison operators (See E011-05) |
  79. | **E031 Identifiers** | | |
  80. | E031-01 Delimited identifiers | TODO | Find out more |
  81. | E021-02 Lower case identifiers | TODO | |
  82. | E021-03 Trailing underscore | N/A | Beam will use whatever column names you specify |
  83. | **E051 Basic query specification** | | |
  84. | E051-01 SELECT DISTINCT | FULL | Use `nub_` |
  85. | E051-02 GROUP BY clause | FULL | See `aggregate_` or read the [section on aggregates](../user-guide/queries/aggregates.md) |
  86. | E051-04 GROUP BY can contain columns not in SELECT | TODO | Unsure how this applies to beam in particular |
  87. | E051-05 Select list items can be renamed | N/A | Beam uses this feature internally, the user never needs it |
  88. | E051-06 HAVING clause | FULL | `guard_` and `filter_` are appropriately converted to `HAVING` when allowed |
  89. | E051-07 Qualified * in select list | N/A | Beam handles projections instead |
  90. | E051-08 Correlation names in FROM | TODO | Unsure how this applies to beam |
  91. | E051-09 Rename columns in the FROM clause | NONE | Beam doesn't need this |
  92. | **E061 Basic predicates and search conditions** | | |
  93. | E061-01 Comparison predicate | FULL | Use the comparison operators (see E011-05) |
  94. | E061-02 BETWEEN predicate | FULL | Use `between_` |
  95. | E061-03 IN predicate with list of values | FULL | Use `in_` |
  96. | E061-04 LIKE predicate | FULL | Use `like_` |
  97. | E061-05 LIKE predicate ESCAPE clause | TODO | Unsure how this would apply |
  98. | E061-06 NULL predicate | FULL | Use `isNothing_` and `isJust_` |
  99. | E061-07 Quantified comparison predicate | FULL | Use one of the *quantified comparison operators* (`==*.`, `/=*.`, `<*.`, `>*.`, `<=*.`, `>=*.`) |
  100. | E051-08 EXISTS predicate | FULL | Use `exists_` |
  101. | E061-09 Subqueries in comparison predicate | FULL | Use `subquery_` as usual |
  102. | E061-11 Subqueries in IN predicate | FULL | |
  103. | E061-12 Subqueries in quantified comparison predicate | FULL | |
  104. | E061-13 Correlated subqueries | FULL | Use `subquery_` |
  105. | E061-14 Search condition | FULL | Construct `QGenExprs` with type `Bool` |
  106. | **E071 Basic query expressions** | | |
  107. | E071-01 UNION DISTINCT table operator | FULL | Use `union_` |
  108. | E071-02 UNION ALL table operator | FULL | Use `unionAll_` |
  109. | E071-03 EXCEPT DISTINCT table operator | FULL | Use `except_` |
  110. | E071-05 Columns combined via operators need not have same type | WONTFIX | Beam is strongly typed |
  111. | E071-06 Table operators in subqueries | FULL | Supported for backends that support it |
  112. | **E081 Basic privileges** | NONE | Database security is not beam's focus. `beam-migrate` may expose this in the future |
  113. | **E091 Set functions** | | |
  114. | E091-01 AVG | FULL | Use `avg_` or `avgOver_` |
  115. | E091-02 COUNT | FULL | Use `countAll_`, `countAllOver_`, `count_`, or `countOver_` |
  116. | E091-03 MAX | FULL | Use `max_` or `maxOver_` |
  117. | E091-04 MIN | FULL | Use `min_` or `minOver_` |
  118. | E091-05 SUM | FULL | Use `sum_` or `sumOver_` |
  119. | E091-06 ALL quantifier | FULL | Use the `*Over_` functions with the `allInGroupExplicitly_` quantifier |
  120. | E091-07 DISTINCT quantifier | FULL | Use the `*Over_` functions with the `distinctInGroup_` quantifier |
  121. | **E101 Basic data manipulation** | | |
  122. | E101-01 INSERT statement | FULL | Use `insert` and `SqlInsert` |
  123. | E101-03 Searched UPDATE | FULL | Use `update` and `SqlUpdate` |
  124. | E101-04 Searched DELETE | FULL | Use `delete` and `SqlDelete` |
  125. | **E111 Single row SELECT statement** | FULL | Use `select` as expected |
  126. | **E121 Basic cursor support** | NONE | Use the backends explicitly |
  127. | **E131 Null value support** | PARTIAL | Use `Maybe` column types, `Nullable`, and the `just_`, `nothing_`, and `maybe_` functions |
  128. | **E141 Basic integrity constraints** | | Implemented in `beam-migrate` |
  129. | E141-01 NOT NULL constraints | FULL | Use `notNull_` |
  130. | E141-02 UNIQUE constraints of NOT NULL columns | TODO | |
  131. | E141-03 PRIMARY KEY constraints | FULL | Instantiate `Table` with the correct `PrimaryKey` |
  132. | E141-04 Basic FOREIGN KEY constraints | TODO | You can embed the `PrimaryKey` of the relation directly. |
  133. | E141-06 CHECK constraints | TODO | |
  134. | E141-07 Column defaults | FULL | Use `default_` from `beam-migrate` |
  135. | E141-08 NOT NULL inferred on PRIMARY KEY | N/A | |
  136. | E141-10 Names in a foreign key can be specified in any order | N/A | |
  137. | **E151 Transaction support** | None | Use the backend functions explicitly |
  138. | **E152 SET TRANSACTION statement** | N/A | |
  139. | **E153 Updatable queries with subqueries** | TODO | Not a common feature, but would be trivial to support |
  140. | **E161 SQL comments with double minus** | N/A | |
  141. | **E171 SQLSTATE support** | N/A | |
  142. | **E182 Host language binding** | N/A | |
  143. | **F031 Basic schema manipulation** | | |
  144. | F031-01 CREATE TABLE for persistent base tables | FULL | Use `createTable_` in `beam-migrate` |
  145. | F031-02 CREATE VIEW statement | TODO | |
  146. | F031-03 GRANT statement | TODO | |
  147. | F031-04 ALTER TABLE statement: ADD COLUMN clause | TODO | |
  148. | F031-13 DROP TABLE statement: RESTRICT clause | TODO | |
  149. | F031-16 DROP VIEW statement: RESTRICT clause | TODO | |
  150. | F031-19 REVOKE statement: RESTRICT clause | NONE | See note for E081 |
  151. | **F032 CASCADE drop behavior** | TODO | Would be in `beam-migrate` |
  152. | **F033 ALTER TABLE statement: DROP COLUMN clause** | TODO | |
  153. | **F034 Extended REVOKE statement** | NONE | |
  154. | **F041 Basic joined table** | | |
  155. | F041-01 Inner join | FULL | Use the [monadic join interface](../user-guide/queries/relationships.md) |
  156. | F041-02 INNER keyword | N/A | The `INNER` keyword is just syntactic sugar. The regular joins do what you want. |
  157. | F041-03 LEFT OUTER JOIN | FULL | Use `leftJoin_` |
  158. | F041-04 RIGHT OUTER JOIN | PARTIAL | Supported in backend syntaxes, not exposed. Can always be written using LEFT OUTER JOIN |
  159. | F041-05 Outer joins can be nested | FULL | `outerJoin_` can be nested arbitrarily |
  160. | F041-07 The inner table in outer join can be used in inner join | TODO | How does this apply to us? |
  161. | F041-08 All comparison operators in JOIN | FULL | Arbitrary `QGenExpr`s are supported. |
  162. | **F051 Basic date and time** | | |
  163. | F051-01 DATE data type | FULL | Use `Day` from `Data.Time` and `val_` |
  164. | F051-02 TIME data type | FULL | Use `TimeOfDay` from `Data.Time` and `val_` |
  165. | F051-03 TIMESTAMP datatype | FULL | Use `LocalTime` from `Data.Time` and `val_`. Precision can be specified in `beam-migrate` |
  166. | F051-04 Comparison predicate on time types | FULL | Use comparison operatiors (See E011-05) |
  167. | F051-05 Explicit cast between date-time types and string | TODO | |
  168. | F051-06 CURRENT\_DATE | TODO | |
  169. | F051-07 LOCALTIME | TODO | |
  170. | F051-08 LOCALTIMESTAMP | TODO | |
  171. | **F081 UNION and EXCEPT in views** | FULL | Views can use any query |
  172. | **F111 Isolation levels other than SERIALIZABLE** | NONE | Use backends |
  173. | **F121 Basic diagnostics mangement** | NONE | Use backends |
  174. | **F122 Extended diagnostics management** | NONE | Use backends |
  175. | **F123 All diagnostics** | NONE | Use backends |
  176. | **F131 Grouped operations** | TODO | Depends on grouped views |
  177. | **F171 Multiple schemas per user** | N/A | Depends on backend |
  178. | **F191 Referential delete actions** | TODO | |
  179. | **F181 Multiple module support** | N/A | |
  180. | **F200 TRUNCATE TABLE statement** | TODO | May be added in the future |
  181. | **F201 CAST function** | FULL | See `cast_` |
  182. | **F202 TRUNCATE TABLE: identity column restart option** | TODO | Depends on F200 |
  183. | **F221 Explicit defaults** | FULL | Use `default_` and `insertExpressions` when inserting |
  184. | **F222 INSERT statement: DEFAULT VALUES clause** | TODO | |
  185. | **F251 Domain support** | PARTIAL | Use `DomainTypeEntity` |
  186. | **F261 CASE expression** | | |
  187. | F261-01 Simple CASE | TODO | Use searched case (see F261-02) |
  188. | F261-02 Searched CASE | FULL | Use `if_`, `then_`, and `else_` |
  189. | F261-03 NULLIF | FULL | Use `nullIf_` |
  190. | F261-04 COALESCE | FULL | Use `coalesce_` |
  191. | **F262 Extended CASE expression** | WONTFIX | Beam allows any expression in a `WHEN` condition |
  192. | **F263 Comma-separater predicates in simple CASE expression** | WONTFIX | Unnecessary |
  193. | **F271 Compound character literals** | N/A | This is syntactic sugar |
  194. | **F281 LIKE enhancements** | FULL | Supported in backends that support this |
  195. | **F291 UNIQUE predicate** | FULL | Use `unique_` |
  196. | **F301 CORRESPONDING in query expressions** | N/A | Beam set functions work based off the query result type, not the column name |
  197. | **F302 INTERSECT table operator** | FULL | Use `intersect_` |
  198. | F302-01 INTERSECT DISTINCT table operator | FULL | Use `intersect_` |
  199. | F302-02 INTERSET ALL table operator | FULL | Use `intersectAll_` |
  200. | **F304 EXCEPT ALL table operator** | FULL | Use `exceptAll_` |
  201. | **F311 Schema definition statement** | TODO | Would be in `beam-migrate` |
  202. | **F312 MERGE statement** | TODO | |
  203. | **F313 Enhanced MERGE statement** | TODO | |
  204. | **F314 MERGE statement with DELETE branch** | TODO | |
  205. | **F321 User authorization** | N/A | |
  206. | **F361 Subprogram support** | N/A | |
  207. | **F381 Extended schema manipulation** | TODO | |
  208. | **F382 Alter column data type** | TODO | |
  209. | **F384 Drop identity property clause** | TODO | |
  210. | **F385 Drop column generation expression clause** | TODO | |
  211. | **F386 Set identity column generation clause** | TODO | |
  212. | **F391 Long identifiers** | FULL | Supported in backends that support it |
  213. | **F392 Unicode escapes in identifiers** | TODO | Unsure how this applies |
  214. | **F393 Unicode escapes in literals** | TODO | Unsure how this applies |
  215. | **F394 Optional normal form specification** | N/A | |
  216. | **F401 Extended joined table** | FULL | Full outer join using `outerJoin_`. Natural join is not needed. A cross join is generated automatically when there are no join conditions. |
  217. | **F402 Named column joins for LOBs, arrays, and multisets** | PARTIAL | Supported in backends that support it |
  218. | **F403 Partitioned join tables** | TODO | |
  219. | **F411 Time zone specification** | TODO | |
  220. | **F421 National character** | FULL | Supported in `beam-migrate` as a data type for `Text` |
  221. | **F431 Read-only scrollable cursors** | N/A | Use the underlying backend |
  222. | **F441 Extended set function support** | TODO | |
  223. | **F442 Mixed column references in set functions** | TODO | Unsure how this would work with beam |
  224. | **F451 Character set definition** | TODO | Likely would go in `beam-migrate` |
  225. | **F461 Named character sets** | TODO | See F451 |
  226. | **F491 Constraint management** | TODO | |
  227. | **F492 Optional table constraint enforcement** | TODO | |
  228. | **F521 Assertions** | TODO | |
  229. | **F531 Temporary tables** | TODO | |
  230. | **F481 Expanded NULL predicate** | FULL | Supported in backends that support it |
  231. | **F555 Enhanced seconds precision** | TODO | |
  232. | **F561 Full value expressions** | TODO | |
  233. | **F571 Truth value tests** | TODO | |
  234. | **F591 Derived tables** | TODO | |
  235. | **F611 Indicator data types** | TODO | |
  236. | **F641 Row and table constructors** | PARTIAL | Use `row_` (TODO) |
  237. | **F651 Catalog name qualifiers** | TODO | |
  238. | **F661 Simple tables** | TODO | |
  239. | **F671 Subqueries in CHECK constraints** | TODO | Planned with E141-06 |
  240. | **F672 Retrospective CHECK constraints** | TODO | Would require temporal DB support |
  241. | **F690 Collation support** | PARTIAL | `beam-migrate` supports some collation features |
  242. | **F692 Enhanced collation support** | TODO | |
  243. | **F693 SQL-session and client module collations** | TODO | |
  244. | **F695 Translation support** | TODO | |
  245. | **F701 Referential update actions** | TODO | |
  246. | **F7