PDO.hx 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /*
  2. * Copyright (C)2005-2017 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 var PARAM_BOOL : Int;
  27. @:phpClassConst static var PARAM_NULL : Int;
  28. @:phpClassConst static var PARAM_INT : Int;
  29. @:phpClassConst static var PARAM_STR : Int;
  30. @:phpClassConst static var PARAM_LOB : Int;
  31. @:phpClassConst static var PARAM_STMT : Int;
  32. @:phpClassConst static var PARAM_INPUT_OUTPUT : Int;
  33. @:phpClassConst static var FETCH_LAZY : Int;
  34. @:phpClassConst static var FETCH_ASSOC : Int;
  35. @:phpClassConst static var FETCH_NAMED : Int;
  36. @:phpClassConst static var FETCH_NUM : Int;
  37. @:phpClassConst static var FETCH_BOTH : Int;
  38. @:phpClassConst static var FETCH_OBJ : Int;
  39. @:phpClassConst static var FETCH_BOUND : Int;
  40. @:phpClassConst static var FETCH_COLUMN : Int;
  41. @:phpClassConst static var FETCH_CLASS : Int;
  42. @:phpClassConst static var FETCH_INTO : Int;
  43. @:phpClassConst static var FETCH_FUNC : Int;
  44. @:phpClassConst static var FETCH_GROUP : Int;
  45. @:phpClassConst static var FETCH_UNIQUE : Int;
  46. @:phpClassConst static var FETCH_KEY_PAIR : Int;
  47. @:phpClassConst static var FETCH_CLASSTYPE : Int;
  48. @:phpClassConst static var FETCH_SERIALIZE : Int;
  49. @:phpClassConst static var FETCH_PROPS_LATE : Int;
  50. @:phpClassConst static var ATTR_AUTOCOMMIT : Int;
  51. @:phpClassConst static var ATTR_PREFETCH : Int;
  52. @:phpClassConst static var ATTR_TIMEOUT : Int;
  53. @:phpClassConst static var ATTR_ERRMODE : Int;
  54. @:phpClassConst static var ATTR_SERVER_VERSION : Int;
  55. @:phpClassConst static var ATTR_CLIENT_VERSION : Int;
  56. @:phpClassConst static var ATTR_SERVER_INFO : Int;
  57. @:phpClassConst static var ATTR_CONNECTION_STATUS : Int;
  58. @:phpClassConst static var ATTR_CASE : Int;
  59. @:phpClassConst static var ATTR_CURSOR_NAME : Int;
  60. @:phpClassConst static var ATTR_CURSOR : Int;
  61. @:phpClassConst static var ATTR_DRIVER_NAME : String;
  62. @:phpClassConst static var ATTR_ORACLE_NULLS : Int;
  63. @:phpClassConst static var ATTR_PERSISTENT : Int;
  64. @:phpClassConst static var ATTR_STATEMENT_CLASS : Int;
  65. @:phpClassConst static var ATTR_FETCH_TABLE_NAMES : Int;
  66. @:phpClassConst static var ATTR_STRINGIFY_FETCHES : Int;
  67. @:phpClassConst static var ATTR_EMULATE_PREPARES : Int;
  68. @:phpClassConst static var ERRMODE_SILENT : Int;
  69. @:phpClassConst static var ERRMODE_WARNING : Int;
  70. @:phpClassConst static var ERRMODE_EXCEPTION : Int;
  71. @:phpClassConst static var CASE_NATURAL : Int;
  72. @:phpClassConst static var CASE_LOWER : Int;
  73. @:phpClassConst static var CASE_UPPER : Int;
  74. @:phpClassConst static var NULL_NATURAL : Int;
  75. @:phpClassConst static var FETCH_ORI_PRIOR : Int;
  76. @:phpClassConst static var FETCH_ORI_FIRST : Int;
  77. @:phpClassConst static var FETCH_ORI_LAST : Int;
  78. @:phpClassConst static var FETCH_ORI_ABS : Int;
  79. @:phpClassConst static var FETCH_ORI_REL : Int;
  80. @:phpClassConst static var CURSOR_FWDONLY : Int;
  81. @:phpClassConst static var CURSOR_SCROLL : Int;
  82. @:phpClassConst static var ERR_NONE : String;
  83. @:phpClassConst static var PARAM_EVT_ALLOC : Int;
  84. @:phpClassConst static var PARAM_EVT_FREE : Int;
  85. @:phpClassConst static var PARAM_EVT_EXEC_PRE : Int;
  86. @:phpClassConst static var PARAM_EVT_EXEC_POST : Int;
  87. @:phpClassConst static var PARAM_EVT_FETCH_PRE : Int;
  88. @:phpClassConst static var PARAM_EVT_FETCH_POST : Int;
  89. @:phpClassConst static var 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. }