questdb 2.0.4__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
questdb/__init__.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = '2.0.4'
@@ -0,0 +1,111 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one
2
+ // or more contributor license agreements. See the NOTICE file
3
+ // distributed with this work for additional information
4
+ // regarding copyright ownership. The ASF licenses this file
5
+ // to you under the Apache License, Version 2.0 (the
6
+ // "License"); you may not use this file except in compliance
7
+ // with the License. You may obtain a copy of the License at
8
+ //
9
+ // http://www.apache.org/licenses/LICENSE-2.0
10
+ //
11
+ // Unless required by applicable law or agreed to in writing,
12
+ // software distributed under the License is distributed on an
13
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ // KIND, either express or implied. See the License for the
15
+ // specific language governing permissions and limitations
16
+ // under the License.
17
+
18
+ #pragma once
19
+
20
+ #include <stdint.h>
21
+
22
+ #ifdef __cplusplus
23
+ extern "C" {
24
+ #endif
25
+
26
+ #ifndef ARROW_C_DATA_INTERFACE
27
+ #define ARROW_C_DATA_INTERFACE
28
+
29
+ #define ARROW_FLAG_DICTIONARY_ORDERED 1
30
+ #define ARROW_FLAG_NULLABLE 2
31
+ #define ARROW_FLAG_MAP_KEYS_SORTED 4
32
+
33
+ struct ArrowSchema {
34
+ // Array type description
35
+ const char* format;
36
+ const char* name;
37
+ const char* metadata;
38
+ int64_t flags;
39
+ int64_t n_children;
40
+ struct ArrowSchema** children;
41
+ struct ArrowSchema* dictionary;
42
+
43
+ // Release callback
44
+ void (*release)(struct ArrowSchema*);
45
+ // Opaque producer-specific data
46
+ void* private_data;
47
+ };
48
+
49
+ struct ArrowArray {
50
+ // Array data description
51
+ int64_t length;
52
+ int64_t null_count;
53
+ int64_t offset;
54
+ int64_t n_buffers;
55
+ int64_t n_children;
56
+ const void** buffers;
57
+ struct ArrowArray** children;
58
+ struct ArrowArray* dictionary;
59
+
60
+ // Release callback
61
+ void (*release)(struct ArrowArray*);
62
+ // Opaque producer-specific data
63
+ void* private_data;
64
+ };
65
+
66
+ #endif // ARROW_C_DATA_INTERFACE
67
+
68
+ #ifndef ARROW_C_STREAM_INTERFACE
69
+ #define ARROW_C_STREAM_INTERFACE
70
+
71
+ struct ArrowArrayStream {
72
+ // Callback to get the stream type
73
+ // (will be the same for all arrays in the stream).
74
+ //
75
+ // Return value: 0 if successful, an `errno`-compatible error code otherwise.
76
+ //
77
+ // If successful, the ArrowSchema must be released independently from the stream.
78
+ int (*get_schema)(struct ArrowArrayStream*, struct ArrowSchema* out);
79
+
80
+ // Callback to get the next array
81
+ // (if no error and the array is released, the stream has ended)
82
+ //
83
+ // Return value: 0 if successful, an `errno`-compatible error code otherwise.
84
+ //
85
+ // If successful, the ArrowArray must be released independently from the stream.
86
+ int (*get_next)(struct ArrowArrayStream*, struct ArrowArray* out);
87
+
88
+ // Callback to get optional detailed error information.
89
+ // This must only be called if the last stream operation failed
90
+ // with a non-0 return code.
91
+ //
92
+ // Return value: pointer to a null-terminated character array describing
93
+ // the last error, or NULL if no description is available.
94
+ //
95
+ // The returned pointer is only valid until the next operation on this stream
96
+ // (including release).
97
+ const char* (*get_last_error)(struct ArrowArrayStream*);
98
+
99
+ // Release callback: release the stream's own resources.
100
+ // Note that arrays returned by `get_next` must be individually released.
101
+ void (*release)(struct ArrowArrayStream*);
102
+
103
+ // Opaque producer-specific data
104
+ void* private_data;
105
+ };
106
+
107
+ #endif // ARROW_C_STREAM_INTERFACE
108
+
109
+ #ifdef __cplusplus
110
+ }
111
+ #endif
@@ -0,0 +1,38 @@
1
+ from libc.stdint cimport int64_t
2
+
3
+ cdef extern from "arrow_c_data_interface.h":
4
+
5
+ cdef int ARROW_FLAG_DICTIONARY_ORDERED
6
+ cdef int ARROW_FLAG_NULLABLE
7
+ cdef int ARROW_FLAG_MAP_KEYS_SORTED
8
+
9
+ cdef struct ArrowSchema:
10
+ # Array type description
11
+ const char* format
12
+ const char* name
13
+ const char* metadata
14
+ int64_t flags
15
+ int64_t n_children
16
+ ArrowSchema** children
17
+ ArrowSchema* dictionary
18
+
19
+ # Release callback
20
+ void (*release)(ArrowSchema*)
21
+ # Opaque producer-specific data
22
+ void* private_data
23
+
24
+ cdef struct ArrowArray:
25
+ # Array data description
26
+ int64_t length
27
+ int64_t null_count
28
+ int64_t offset
29
+ int64_t n_buffers
30
+ int64_t n_children
31
+ const void** buffers
32
+ ArrowArray** children
33
+ ArrowArray* dictionary
34
+
35
+ # Release callback
36
+ void (*release)(ArrowArray*)
37
+ # Opaque producer-specific data
38
+ void* private_data
questdb/conf_str.h ADDED
@@ -0,0 +1,55 @@
1
+ #pragma once
2
+
3
+ #include <stdint.h>
4
+ #include <stdbool.h>
5
+
6
+ #if defined(__cplusplus)
7
+ extern "C" {
8
+ #endif
9
+
10
+ typedef struct questdb_conf_str questdb_conf_str;
11
+
12
+ struct questdb_conf_str_parse_err {
13
+ const char* msg;
14
+ size_t msg_len;
15
+ size_t pos;
16
+ };
17
+
18
+ typedef struct questdb_conf_str_parse_err questdb_conf_str_parse_err;
19
+
20
+ void questdb_conf_str_parse_err_free(questdb_conf_str_parse_err* err);
21
+
22
+ typedef struct questdb_conf_str_iter questdb_conf_str_iter;
23
+
24
+ questdb_conf_str* questdb_conf_str_parse(
25
+ const char* str,
26
+ size_t len,
27
+ questdb_conf_str_parse_err** err_out);
28
+
29
+ const char* questdb_conf_str_service(
30
+ const questdb_conf_str* conf_str,
31
+ size_t* len_out);
32
+
33
+ const char* questdb_conf_str_get(
34
+ const questdb_conf_str* conf_str,
35
+ const char* key,
36
+ size_t key_len,
37
+ size_t* val_len_out);
38
+
39
+ questdb_conf_str_iter* questdb_conf_str_iter_pairs(
40
+ const questdb_conf_str* conf_str);
41
+
42
+ bool questdb_conf_str_iter_next(
43
+ questdb_conf_str_iter* iter,
44
+ const char** key_out,
45
+ size_t* key_len_out,
46
+ const char** val_out,
47
+ size_t* val_len_out);
48
+
49
+ void questdb_conf_str_iter_free(questdb_conf_str_iter* iter);
50
+
51
+ void questdb_conf_str_free(questdb_conf_str* str);
52
+
53
+ #if defined(__cplusplus)
54
+ }
55
+ #endif
questdb/conf_str.pxd ADDED
@@ -0,0 +1,60 @@
1
+ # The C API is compiled through the `questdb-rs-ffi` via the `conf_str` feature.
2
+ # Search for the "confstr-ffi" feature in the code base to understand how it all
3
+ # wires up together.
4
+
5
+ # See: https://github.com/questdb/questdb-confstr-rs/blob/
6
+ # 0.1.0/questdb-confstr-ffi/include/questdb/conf_str.h
7
+
8
+ cdef extern from "conf_str.h":
9
+ cdef struct questdb_conf_str:
10
+ pass
11
+
12
+ cdef struct questdb_conf_str_parse_err:
13
+ const char* msg
14
+ size_t msg_len
15
+ size_t pos
16
+
17
+ void questdb_conf_str_parse_err_free(
18
+ questdb_conf_str_parse_err* err
19
+ ) noexcept nogil
20
+
21
+ cdef struct questdb_conf_str_iter:
22
+ pass
23
+
24
+ questdb_conf_str* questdb_conf_str_parse(
25
+ const char* string,
26
+ size_t len,
27
+ questdb_conf_str_parse_err** err_out
28
+ ) noexcept nogil
29
+
30
+ const char* questdb_conf_str_service(
31
+ const questdb_conf_str* conf_str,
32
+ size_t* len_out
33
+ ) noexcept nogil
34
+
35
+ const char* questdb_conf_str_get(
36
+ const questdb_conf_str* conf_str,
37
+ const char* key,
38
+ size_t key_len,
39
+ size_t* val_len_out
40
+ ) noexcept nogil
41
+
42
+ questdb_conf_str_iter* questdb_conf_str_iter_pairs(
43
+ const questdb_conf_str* conf_str
44
+ ) noexcept nogil
45
+
46
+ bint questdb_conf_str_iter_next(
47
+ questdb_conf_str_iter* iter,
48
+ const char** key_out,
49
+ size_t* key_len_out,
50
+ const char** val_out,
51
+ size_t* val_len_out
52
+ ) noexcept nogil
53
+
54
+ void questdb_conf_str_iter_free(
55
+ questdb_conf_str_iter* iter
56
+ ) noexcept nogil
57
+
58
+ void questdb_conf_str_free(
59
+ questdb_conf_str* str
60
+ ) noexcept nogil