PDO.hx 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Copyright (C)2005-2019 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. package php.db;
  23. import php.*;
  24. @:native('PDO')
  25. extern class PDO {
  26. @:phpClassConst static final PARAM_BOOL:Int;
  27. @:phpClassConst static final PARAM_NULL:Int;
  28. @:phpClassConst static final PARAM_INT:Int;
  29. @:phpClassConst static final PARAM_STR:Int;
  30. @:phpClassConst static final PARAM_LOB:Int;
  31. @:phpClassConst static final PARAM_STMT:Int;
  32. @:phpClassConst static final PARAM_INPUT_OUTPUT:Int;
  33. @:phpClassConst static final FETCH_LAZY:Int;
  34. @:phpClassConst static final FETCH_ASSOC:Int;
  35. @:phpClassConst static final FETCH_NAMED:Int;
  36. @:phpClassConst static final FETCH_NUM:Int;
  37. @:phpClassConst static final FETCH_BOTH:Int;
  38. @:phpClassConst static final FETCH_OBJ:Int;
  39. @:phpClassConst static final FETCH_BOUND:Int;
  40. @:phpClassConst static final FETCH_COLUMN:Int;
  41. @:phpClassConst static final FETCH_CLASS:Int;
  42. @:phpClassConst static final FETCH_INTO:Int;
  43. @:phpClassConst static final FETCH_FUNC:Int;
  44. @:phpClassConst static final FETCH_GROUP:Int;
  45. @:phpClassConst static final FETCH_UNIQUE:Int;
  46. @:phpClassConst static final FETCH_KEY_PAIR:Int;
  47. @:phpClassConst static final FETCH_CLASSTYPE:Int;
  48. @:phpClassConst static final FETCH_SERIALIZE:Int;
  49. @:phpClassConst static final FETCH_PROPS_LATE:Int;
  50. @:phpClassConst static final ATTR_AUTOCOMMIT:Int;
  51. @:phpClassConst static final ATTR_PREFETCH:Int;
  52. @:phpClassConst static final ATTR_TIMEOUT:Int;
  53. @:phpClassConst static final ATTR_ERRMODE:Int;
  54. @:phpClassConst static final ATTR_SERVER_VERSION:Int;
  55. @:phpClassConst static final ATTR_CLIENT_VERSION:Int;
  56. @:phpClassConst static final ATTR_SERVER_INFO:Int;
  57. @:phpClassConst static final ATTR_CONNECTION_STATUS:Int;
  58. @:phpClassConst static final ATTR_CASE:Int;
  59. @:phpClassConst static final ATTR_CURSOR_NAME:Int;
  60. @:phpClassConst static final ATTR_CURSOR:Int;
  61. @:phpClassConst static final ATTR_DRIVER_NAME:String;
  62. @:phpClassConst static final ATTR_ORACLE_NULLS:Int;
  63. @:phpClassConst static final ATTR_PERSISTENT:Int;
  64. @:phpClassConst static final ATTR_STATEMENT_CLASS:Int;
  65. @:phpClassConst static final ATTR_FETCH_TABLE_NAMES:Int;
  66. @:phpClassConst static final ATTR_STRINGIFY_FETCHES:Int;
  67. @:phpClassConst static final ATTR_EMULATE_PREPARES:Int;
  68. @:phpClassConst static final ERRMODE_SILENT:Int;
  69. @:phpClassConst static final ERRMODE_WARNING:Int;
  70. @:phpClassConst static final ERRMODE_EXCEPTION:Int;
  71. @:phpClassConst static final CASE_NATURAL:Int;
  72. @:phpClassConst static final CASE_LOWER:Int;
  73. @:phpClassConst static final CASE_UPPER:Int;
  74. @:phpClassConst static final NULL_NATURAL:Int;
  75. @:phpClassConst static final FETCH_ORI_PRIOR:Int;
  76. @:phpClassConst static final FETCH_ORI_FIRST:Int;
  77. @:phpClassConst static final FETCH_ORI_LAST:Int;
  78. @:phpClassConst static final FETCH_ORI_ABS:Int;
  79. @:phpClassConst static final FETCH_ORI_REL:Int;
  80. @:phpClassConst static final CURSOR_FWDONLY:Int;
  81. @:phpClassConst static final CURSOR_SCROLL:Int;
  82. @:phpClassConst static final ERR_NONE:String;
  83. @:phpClassConst static final PARAM_EVT_ALLOC:Int;
  84. @:phpClassConst static final PARAM_EVT_FREE:Int;
  85. @:phpClassConst static final PARAM_EVT_EXEC_PRE:Int;
  86. @:phpClassConst static final PARAM_EVT_EXEC_POST:Int;
  87. @:phpClassConst static final PARAM_EVT_FETCH_PRE:Int;
  88. @:phpClassConst static final PARAM_EVT_FETCH_POST:Int;
  89. @:phpClassConst static final PARAM_EVT_NORMALIZE:Int;
  90. function new(dns:String, ?username:String, ?password:String, ?options:NativeArray):Void;
  91. function beginTransaction():Bool;
  92. function commit():Bool;
  93. function errorCode():Dynamic;
  94. function errorInfo():NativeArray;
  95. function exec(statement:String):Int;
  96. function getAttribute(attribute:Int):Dynamic;
  97. function getAvailableDrivers():NativeArray;
  98. function lastInsertId(?name:String):String;
  99. function prepare(statement:String, ?driver_options:NativeArray):PDOStatement;
  100. function query(statement:String, ?mode:Int):PDOStatement;
  101. function quote(String:String, ?parameter_type:Int = 2):String;
  102. function rollBack():Bool;
  103. function setAttribute(attribute:Int, value:Dynamic):Bool;
  104. }