sqlalchemy-iris 0.5.0b3__py3-none-any.whl → 0.6.0b1__py3-none-any.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.
Files changed (77) hide show
  1. intersystems_iris/_BufferReader.py +10 -0
  2. intersystems_iris/_BufferWriter.py +32 -0
  3. intersystems_iris/_ConnectionInformation.py +54 -0
  4. intersystems_iris/_ConnectionParameters.py +18 -0
  5. intersystems_iris/_Constant.py +38 -0
  6. intersystems_iris/_DBList.py +499 -0
  7. intersystems_iris/_Device.py +69 -0
  8. intersystems_iris/_GatewayContext.py +25 -0
  9. intersystems_iris/_GatewayException.py +4 -0
  10. intersystems_iris/_GatewayUtility.py +74 -0
  11. intersystems_iris/_IRIS.py +1294 -0
  12. intersystems_iris/_IRISConnection.py +516 -0
  13. intersystems_iris/_IRISEmbedded.py +85 -0
  14. intersystems_iris/_IRISGlobalNode.py +273 -0
  15. intersystems_iris/_IRISGlobalNodeView.py +25 -0
  16. intersystems_iris/_IRISIterator.py +143 -0
  17. intersystems_iris/_IRISList.py +360 -0
  18. intersystems_iris/_IRISNative.py +208 -0
  19. intersystems_iris/_IRISOREF.py +4 -0
  20. intersystems_iris/_IRISObject.py +424 -0
  21. intersystems_iris/_IRISReference.py +133 -0
  22. intersystems_iris/_InStream.py +149 -0
  23. intersystems_iris/_LegacyIterator.py +135 -0
  24. intersystems_iris/_ListItem.py +15 -0
  25. intersystems_iris/_ListReader.py +84 -0
  26. intersystems_iris/_ListWriter.py +157 -0
  27. intersystems_iris/_LogFileStream.py +115 -0
  28. intersystems_iris/_MessageHeader.py +51 -0
  29. intersystems_iris/_OutStream.py +25 -0
  30. intersystems_iris/_PrintStream.py +65 -0
  31. intersystems_iris/_PythonGateway.py +850 -0
  32. intersystems_iris/_SharedMemorySocket.py +87 -0
  33. intersystems_iris/__init__.py +79 -0
  34. intersystems_iris/__main__.py +7 -0
  35. intersystems_iris/dbapi/_Column.py +56 -0
  36. intersystems_iris/dbapi/_DBAPI.py +2295 -0
  37. intersystems_iris/dbapi/_Descriptor.py +46 -0
  38. intersystems_iris/dbapi/_IRISStream.py +63 -0
  39. intersystems_iris/dbapi/_Message.py +158 -0
  40. intersystems_iris/dbapi/_Parameter.py +138 -0
  41. intersystems_iris/dbapi/_ParameterCollection.py +133 -0
  42. intersystems_iris/dbapi/_ResultSetRow.py +314 -0
  43. intersystems_iris/dbapi/_SQLType.py +32 -0
  44. intersystems_iris/dbapi/__init__.py +0 -0
  45. intersystems_iris/dbapi/preparser/_PreParser.py +1658 -0
  46. intersystems_iris/dbapi/preparser/_Scanner.py +391 -0
  47. intersystems_iris/dbapi/preparser/_Token.py +81 -0
  48. intersystems_iris/dbapi/preparser/_TokenList.py +251 -0
  49. intersystems_iris/dbapi/preparser/__init__.py +0 -0
  50. intersystems_iris/pex/_BusinessHost.py +101 -0
  51. intersystems_iris/pex/_BusinessOperation.py +105 -0
  52. intersystems_iris/pex/_BusinessProcess.py +214 -0
  53. intersystems_iris/pex/_BusinessService.py +95 -0
  54. intersystems_iris/pex/_Common.py +228 -0
  55. intersystems_iris/pex/_Director.py +24 -0
  56. intersystems_iris/pex/_IRISBusinessOperation.py +5 -0
  57. intersystems_iris/pex/_IRISBusinessService.py +18 -0
  58. intersystems_iris/pex/_IRISInboundAdapter.py +5 -0
  59. intersystems_iris/pex/_IRISOutboundAdapter.py +17 -0
  60. intersystems_iris/pex/_InboundAdapter.py +57 -0
  61. intersystems_iris/pex/_Message.py +6 -0
  62. intersystems_iris/pex/_OutboundAdapter.py +46 -0
  63. intersystems_iris/pex/__init__.py +25 -0
  64. iris/__init__.py +25 -0
  65. iris/iris_site.py +13 -0
  66. iris/irisbuiltins.py +97 -0
  67. iris/irisloader.py +199 -0
  68. irisnative/_IRISNative.py +9 -0
  69. irisnative/__init__.py +10 -0
  70. {sqlalchemy_iris-0.5.0b3.dist-info → sqlalchemy_iris-0.6.0b1.dist-info}/METADATA +1 -1
  71. sqlalchemy_iris-0.6.0b1.dist-info/RECORD +83 -0
  72. sqlalchemy_iris-0.6.0b1.dist-info/top_level.txt +4 -0
  73. sqlalchemy_iris-0.5.0b3.dist-info/RECORD +0 -14
  74. sqlalchemy_iris-0.5.0b3.dist-info/top_level.txt +0 -1
  75. {sqlalchemy_iris-0.5.0b3.dist-info → sqlalchemy_iris-0.6.0b1.dist-info}/LICENSE +0 -0
  76. {sqlalchemy_iris-0.5.0b3.dist-info → sqlalchemy_iris-0.6.0b1.dist-info}/WHEEL +0 -0
  77. {sqlalchemy_iris-0.5.0b3.dist-info → sqlalchemy_iris-0.6.0b1.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,87 @@
1
+ import ctypes
2
+ import os
3
+
4
+ class IOBUFFER_STRUCT(ctypes.Structure):
5
+ _fields_ = [("send_buffer", ctypes.POINTER(ctypes.c_char)),
6
+ ("send_length", ctypes.c_int),
7
+ ("receive_buffer", ctypes.POINTER(ctypes.c_char)),
8
+ ("receive_length", ctypes.c_int),
9
+ ("status", ctypes.c_short)]
10
+
11
+ class _SharedMemorySocket(object):
12
+
13
+ def __init__(self, iris_installation_dir, pid, filename):
14
+ if os.name != "nt":
15
+ self._module = ctypes.cdll.LoadLibrary(os.path.join(iris_installation_dir + "bin", "libxdevshm.so"))
16
+ pointer_type = ctypes.c_int64
17
+ elif ctypes.sizeof(ctypes.c_voidp) > 4:
18
+ self._module = ctypes.cdll.LoadLibrary(os.path.join(iris_installation_dir + "bin", "XDEVshm.dll"))
19
+ pointer_type = ctypes.c_int64
20
+ else:
21
+ self._module = ctypes.cdll.LoadLibrary(os.path.join(iris_installation_dir + "bin", "XDEVshm32.dll"))
22
+ pointer_type = ctypes.c_int32
23
+ self._module.SharedMemory_InitializeWithName.argtypes = tuple([ctypes.c_void_p, ctypes.c_uint, ctypes.c_char_p])
24
+ self._module.SharedMemory_Connect.argtypes = tuple([pointer_type, ctypes.c_uint, ctypes.c_int, ctypes.c_void_p])
25
+ self._module.SharedMemory_IOBuffer_Initialize.argtypes = tuple([pointer_type, ctypes.POINTER(IOBUFFER_STRUCT)])
26
+ self._module.SharedMemory_IOBuffer_Read.argtypes = tuple([pointer_type])
27
+ self._module.SharedMemory_IOBuffer_Write.argtypes = tuple([pointer_type])
28
+ self._module.SharedMemory_Close.argtypes = tuple([pointer_type])
29
+ shm_pointer = ctypes.c_void_p(0)
30
+ self._iobuffer = None
31
+ if self._module.SharedMemory_InitializeWithName(ctypes.byref(shm_pointer), int(pid), ctypes.c_char_p(filename)) != 0:
32
+ raise Exception("Could not initialize shared memory")
33
+ self._shm_pointer = shm_pointer.value
34
+ if self._shm_pointer==0:
35
+ raise Exception("Could not create shared memory")
36
+ return
37
+
38
+ def connect(self):
39
+ # flag harcoded to 0. change to 1 to generate shared memory log.
40
+ # timeout hardcoded to 10. user specified timeout was used to TCP/IP and not used here.
41
+ if self._module.SharedMemory_Connect(self._shm_pointer, 0, 10, ctypes.byref(ctypes.c_int(0))) != 0:
42
+ raise Exception("Could not connect shared memory")
43
+ initial_allocation_size = 256
44
+ self._send_buffer = ctypes.create_string_buffer(initial_allocation_size)
45
+ self._receive_buffer = ctypes.create_string_buffer(initial_allocation_size)
46
+ self._iobuffer = IOBUFFER_STRUCT(self._send_buffer,0,self._receive_buffer,0,0)
47
+ if self._module.SharedMemory_IOBuffer_Initialize(self._shm_pointer, ctypes.byref(self._iobuffer)):
48
+ raise Exception("Could not initialize iobuffer for shared memory")
49
+ return
50
+
51
+ def close(self):
52
+ if self._module.SharedMemory_Close(self._shm_pointer) != 0:
53
+ raise Exception("Could not close shared memory")
54
+ self._shm_pointer=0
55
+ return
56
+
57
+ def sendall(self, buffer):
58
+ if len(buffer) > len(self._send_buffer):
59
+ self._send_buffer = ctypes.create_string_buffer(len(buffer))
60
+ self._iobuffer.send_buffer = self._send_buffer
61
+ self._send_buffer[0:len(buffer)] = buffer
62
+ self._iobuffer.send_length = len(buffer)
63
+ self._iobuffer.status = -1
64
+ self._module.SharedMemory_IOBuffer_Write(self._shm_pointer)
65
+ if self._iobuffer.status != 0:
66
+ raise Exception("Could not send data via shared memory")
67
+ return
68
+
69
+ def recv(self, length_requesting):
70
+ if length_requesting > len(self._receive_buffer):
71
+ self._receive_buffer = ctypes.create_string_buffer(length_requesting)
72
+ self._iobuffer.receive_buffer = self._receive_buffer
73
+ self._iobuffer.receive_length = length_requesting
74
+ self._iobuffer.status = -1
75
+ self._module.SharedMemory_IOBuffer_Read(self._shm_pointer)
76
+ if self._iobuffer.status != 0:
77
+ raise Exception("Could not read data via shared memory")
78
+ return self._receive_buffer[0:self._iobuffer.receive_length]
79
+
80
+ def settimeout(self, timeout):
81
+ return
82
+
83
+ def gethostname(self):
84
+ return ""
85
+
86
+ def gethostbyname(self, hostname):
87
+ return ""
@@ -0,0 +1,79 @@
1
+ '''
2
+ IRIS Native API for Python.
3
+
4
+ This module provides highly efficient and lightweight access to IRIS,
5
+ including the Global Module and object oriented programming environment.
6
+ '''
7
+ from . import _BufferReader
8
+ from . import _BufferWriter
9
+ from . import _ConnectionInformation
10
+ from . import _ConnectionParameters
11
+ from . import _Constant
12
+ from . import _Device
13
+ from . import _DBList
14
+ from . import _GatewayContext
15
+ from . import _GatewayException
16
+ from . import _GatewayUtility
17
+ from . import _InStream
18
+ from . import _IRIS
19
+ from . import _IRISConnection
20
+ from . import _IRISGlobalNode
21
+ from . import _IRISGlobalNodeView
22
+ from . import _IRISIterator
23
+ from . import _IRISList
24
+ from . import _IRISObject
25
+ from . import _IRISOREF
26
+ from . import _IRISReference
27
+ from . import _LegacyIterator
28
+ from . import _ListItem
29
+ from . import _ListReader
30
+ from . import _ListWriter
31
+ from . import _LogFileStream
32
+ from . import _MessageHeader
33
+ from . import _OutStream
34
+ from . import _PrintStream
35
+ from . import _PythonGateway
36
+
37
+ from intersystems_iris._IRISNative import connect # noqa
38
+ from intersystems_iris._IRISNative import createConnection # noqa
39
+ from intersystems_iris._IRISNative import createIRIS # noqa
40
+
41
+
42
+ class GatewayContext(_GatewayContext._GatewayContext):
43
+ pass
44
+
45
+
46
+ class IRIS(_IRIS._IRIS):
47
+ pass
48
+
49
+
50
+ class IRISConnection(_IRISConnection._IRISConnection):
51
+ pass
52
+
53
+
54
+ class IRISGlobalNode(_IRISGlobalNode._IRISGlobalNode):
55
+ pass
56
+
57
+
58
+ class IRISGlobalNodeView(_IRISGlobalNodeView._IRISGlobalNodeView):
59
+ pass
60
+
61
+
62
+ class IRISIterator(_IRISIterator._IRISIterator):
63
+ pass
64
+
65
+
66
+ class IRISList(_IRISList._IRISList):
67
+ pass
68
+
69
+
70
+ class IRISObject(_IRISObject._IRISObject):
71
+ pass
72
+
73
+
74
+ class IRISReference(_IRISReference._IRISReference):
75
+ pass
76
+
77
+
78
+ class LegacyIterator(_LegacyIterator._LegacyIterator):
79
+ pass
@@ -0,0 +1,7 @@
1
+ import sys
2
+ import intersystems_iris._PythonGateway
3
+
4
+ if len(sys.argv) >= 2 and sys.argv[1] == "PythonGateway":
5
+ intersystems_iris._PythonGateway._PythonGateway._main(sys.argv[2:])
6
+ else:
7
+ print("Invalid Parameter")
@@ -0,0 +1,56 @@
1
+ import intersystems_iris.dbapi._Descriptor
2
+
3
+ class _Column(intersystems_iris.dbapi._Descriptor._Descriptor):
4
+ def __init__(self, name, type, precision, scale, nullable, label, tableName, schema, catalog, additionalData, slotPosition):
5
+ name = str(name)
6
+ label = str(label)
7
+ tableName = str(tableName)
8
+ schema = str(schema)
9
+ if catalog is not None:
10
+ catalog = str(catalog)
11
+ try:
12
+ slotPosition = int(slotPosition)
13
+ except (TypeError, ValueError):
14
+ raise TypeError("slotPosition must be an integer")
15
+ if slotPosition < 0:
16
+ raise ValueError("slotPosition must be positive")
17
+
18
+ super().__init__(type, precision, scale, nullable)
19
+ self.name = name
20
+ self.slotPosition = slotPosition
21
+ self.label = label
22
+ self.tableName = tableName
23
+ self.schema = schema
24
+ self.catalog = catalog
25
+ additionalDataFlags = []
26
+ for v in additionalData:
27
+ additionalDataFlags.append(bool(v))
28
+ for i in range(12 - len(additionalDataFlags)):
29
+ additionalDataFlags.append(False)
30
+ self.isAutoIncrement = bool(additionalDataFlags[0])
31
+ self.isCaseSensitive = bool(additionalDataFlags[1])
32
+ self.isCurrency = bool(additionalDataFlags[2])
33
+ self.isReadOnly = bool(additionalDataFlags[3])
34
+ self.isRowVersion = bool(additionalDataFlags[4])
35
+ self.isUnique = bool(additionalDataFlags[5])
36
+ self.isAliased = bool(additionalDataFlags[6])
37
+ self.isExpression = bool(additionalDataFlags[7])
38
+ self.isHidden = bool(additionalDataFlags[8])
39
+ self.isIdentity = bool(additionalDataFlags[9])
40
+ self.isKeyColumn = bool(additionalDataFlags[10])
41
+ self.isRowId = bool(additionalDataFlags[11])
42
+
43
+ def Clone(self):
44
+ additionalData = [self.isAutoIncrement,
45
+ self.isCaseSensitive,
46
+ self.isCurrency,
47
+ self.isReadOnly,
48
+ self.isRowVersion,
49
+ self.isUnique,
50
+ self.isAliased,
51
+ self.isExpression,
52
+ self.isHidden,
53
+ self.isIdentity,
54
+ self.isKeyColumn,
55
+ self.isRowId]
56
+ return _Column(self.name, self.type, self.precision, self.scale, self.nullable, self.label, self.tableName, self.schema, self.catalog, additionalData, self.slotPosition)