Skip to content

Commit

Permalink
add Info types to determine cursor capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman82 committed Oct 17, 2023
1 parent 61abd4d commit 787c0b9
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "odbc-sys"
version = "0.21.4"
version = "0.22.0"
authors = ["Markus Klein"]
license = "MIT"
description = "ODBC ffi bindings"
Expand Down
5 changes: 5 additions & 0 deletions Changelog.md
@@ -1,6 +1,11 @@
Changelog
=========

0.22.0
------

* Extend `InfoType` to determine cursor capabilities. E.g. `InfoType::ScrollOptions`

0.21.4
------

Expand Down
4 changes: 2 additions & 2 deletions src/functions.rs
Expand Up @@ -531,7 +531,7 @@ extern "system" {
pub fn SQLCopyDesc(source_desc_handle: HDesc, target_desc_handle: HDesc) -> SqlReturn;

/// Returns the current setting of a connection attribute.
///
///
/// * `buffer_length`: is either buffer length or one of [`crate::IS_POINTER`],
/// [`crate::IS_UINTEGER`], [`crate::IS_INTEGER`], [`crate::IS_USMALLINT`] or
/// [`crate::IS_SMALLINT`].
Expand All @@ -547,7 +547,7 @@ extern "system" {
) -> SqlReturn;

/// Returns the current setting of a connection attribute.
///
///
/// * `buffer_length`: is either buffer length or one of [`crate::IS_POINTER`],
/// [`crate::IS_UINTEGER`], [`crate::IS_INTEGER`], [`crate::IS_USMALLINT`] or
/// [`crate::IS_SMALLINT`].
Expand Down
41 changes: 41 additions & 0 deletions src/info_type.rs
Expand Up @@ -23,6 +23,11 @@ pub enum InfoType {
MaxCatalogNameLen = 34,
MaxTableNameLen = 35,
// ScrollConcurrency = 43, deprecated in ODBC 3
/// `SQL_SCROLL_OPTIONS` C-API places this in the extended header. Lists the supported cursor
/// types (forward-only, static, keyset-driven, dynamic, or mixed). All data sources must
/// support forward-only cursors. See:
/// <https://learn.microsoft.com/sql/odbc/reference/develop-app/determining-cursor-capabilities>
ScrollOptions = 44,
TransactionCapable = 46,
UserName = 47,
TransactionIsolationProtocol = 72,
Expand All @@ -43,6 +48,42 @@ pub enum InfoType {
MaxTablesInSelect = 106,
MaxUserNameLen = 107,
OuterJoinCapabilities = 115,
/// `DYNAMIC_CURSOR_ATTRIBUTES1` C-API places this in the extended header. Lists the fetch types
/// supported by scrollable cursors. The bits in the return value correspond to the fetch types
/// in SQLFetchScroll. See:
/// <https://learn.microsoft.com/sql/odbc/reference/develop-app/determining-cursor-capabilities>
DynamicCursorAttributes1 = 144,
/// `SQL_DYNAMIC_CURSOR_ATTRIBUTES2` C-API places this in the extended header. Lists whether
/// cursors can detect their own updates, deletes, and inserts. See:
/// <https://learn.microsoft.com/sql/odbc/reference/develop-app/determining-cursor-capabilities>
DynamicCursorAttributes2 = 145,
/// `SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1` C-API places this in the extended header. Lists the
/// fetch types supported by scrollable cursors. The bits in the return value correspond to the
/// fetch types in SQLFetchScroll. See:
/// <https://learn.microsoft.com/sql/odbc/reference/develop-app/determining-cursor-capabilities>
ForwardOnlyCursorAttributes1 = 146,
/// `SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2` C-API places this in the extended header. Lists
/// whether cursors can detect their own updates, deletes, and inserts. See:
/// <https://learn.microsoft.com/sql/odbc/reference/develop-app/determining-cursor-capabilities>
ForwardOnlyCursorAttributes2 = 147,
/// `SQL_KEYSET_CURSOR_ATTRIBUTES1` C-API places this in the extended header. Lists the fetch
/// types supported by scrollable cursors. The bits in the return value correspond to the fetch
/// types in SQLFetchScroll. See:
/// <https://learn.microsoft.com/sql/odbc/reference/develop-app/determining-cursor-capabilities>
KeysetCursorAttributes1 = 150,
/// `SQL_KEYSET_CURSOR_ATTRIBUTES2` C-API places this in the extended header. Lists whether
/// cursors can detect their own updates, deletes, and inserts. See:
/// <https://learn.microsoft.com/sql/odbc/reference/develop-app/determining-cursor-capabilities>
KeysetCursorAttributes2 = 151,
/// `SQL_STATIC_CURSOR_ATTRIBUTES1` C-API places this in the extended header. Lists the fetch
/// types supported by scrollable cursors. The bits in the return value correspond to the fetch
/// types in SQLFetchScroll. See:
/// <https://learn.microsoft.com/sql/odbc/reference/develop-app/determining-cursor-capabilities>
StaticCursorAttributes1 = 167,
/// `SQL_STATIC_CURSOR_ATTRIBUTES2` C-API places this in the extended header. Lists whether
/// cursors can detect their own updates, deletes, and inserts. See:
/// <https://learn.microsoft.com/sql/odbc/reference/develop-app/determining-cursor-capabilities>
StaticCursorAttributes2 = 168,
XopenCliYear = 10000,
CursorSensitivity = 10001,
DescribeParameter = 10002,
Expand Down

0 comments on commit 787c0b9

Please sign in to comment.