/usr/share/GNUstep/Documentation/SQLClient/SQLClient.html is in libsqlclient-dev 1.7.3-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>SQLClient documentation</title>
</head>
<body>
<font face="serif">
<h1><a name="title$SQLClient">SQLClient documentation</a></h1>
<h3>Authors</h3>
<dl>
<dt>Richard Frith-Macdonald (<a href="mailto:rfm@gnu.org"><code>rfm@gnu.org</code></a>)</dt>
<dd>
</dd>
</dl>
<p><b>Version:</b> 37913</p>
<p><b>Date:</b> 2014-05-27 16:22:35 +0100 (Tue, 27 May 2014)</p>
<p><b>Copyright:</b> (C) 2004 Free Software Foundation, Inc.</p>
<div>
<hr width="50%" align="left" />
<h3>Contents -</h3>
<ol>
<li>
<a href="#001000000000">The SQLClient library</a>
</li>
<li>
<a href="#001001000000">What is the SQLClient library?</a>
</li>
<li>
<a href="#001002000000">What backend bundles are available?</a>
</li>
<li>
<a href="#001003000000">Where can you get it? How can you install it?</a>
</li>
<li>
<a href="#002000000000">Software documentation for the SQLClient class</a>
</li>
<li>
<a href="#003000000000">Software documentation for the SQLDictionaryBuilder
class</a>
</li>
<li>
<a href="#004000000000">Software documentation for the SQLRecord class</a>
</li>
<li>
<a href="#005000000000">Software documentation for the SQLSetBuilder class</a>
</li>
<li>
<a href="#006000000000">Software documentation for the SQLSingletonBuilder
class</a>
</li>
<li>
<a href="#007000000000">Software documentation for the SQLTransaction class</a>
</li>
<li>
<a href="#008000000000">Software documentation for the SQLClient(Caching)
category</a>
</li>
<li>
<a href="#009000000000">Software documentation for the SQLClient(Convenience)
category</a>
</li>
<li>
<a href="#010000000000">Software documentation for the SQLClient(Logging)
category</a>
</li>
<li>
<a href="#011000000000">Software documentation for the
SQLClient(Notifications) category</a>
</li>
<li>
<a href="#012000000000">Software documentation for the SQLClient(Subclass)
category</a>
</li>
<li>
<a href="#013000000000">SQLClient constants</a>
</li>
<li>
<a href="#014000000000">SQLClient variables</a>
</li>
<li>
<a href="#015000000000">SQLClient functions</a>
</li>
</ol>
<hr width="50%" align="left" />
</div>
<h1><a name="001000000000">The SQLClient library</a></h1>
<h2><a name="001001000000">What is the SQLClient library?</a></h2>
<p>
The SQLClient library is designed to provide a simple
interface to SQL databases for GNUstep
applications. It does not attempt the sort of
abstraction provided by the much more
sophisticated GDL2 library, but rather allows
applications to directly execute SQL queries and
statements.
</p>
<p>
SQLClient provides for the Objective-C programmer
much the same thing that JDBC provides for the Java
programmer (though SQLClient is a bit faster,
easier to use, and easier to add new database backends
for than JDBC).
</p>
<p>
The major features of the SQLClient library are -
</p>
<ul>
<li>
Simple API for executing queries and statements... a
variable length sequence of comma separated
strings and other objects (NSNumber, NSDate,
NSData) are concatenated into a single SQL
statement and executed.
</li>
<li>
Simple API
<a rel="gsdoc" href="#class$SQLTransaction">SQLTransaction</a>
)for combining multiple SQL statements into a single
transaction which can be used to minimise
client-server interactions to get the best
possible performance from your database.
</li>
<li>
Supports multiple sumultaneous named connections
to a database server in a thread-safe manner. <br />
</li>
<li>
Supports multiple simultaneous connections to
different database servers with backend driver
bundles loaded for different database engines.
Clear, simple subclassing of the abstract base
class to enable easy implementation of new backend
bundles.
</li>
<li>
Configuration for all connections held in
one place and referenced by connection name for ease
of configuration control. Changes via NSUserDefaults
can even allow reconfiguration of client instances
within a running application.
</li>
<li>
Thread safe operation... The base class supports
locking such that a single instance can be shared
between multiple threads.
</li>
<li>
Support for standalone web applications... eg to
allow data to be added to the database by people
posting web forms to the application.
</li>
<li>
Supports notification of connection to and
disconnection from the database server.
</li>
</ul>
<h2><a name="001002000000">
What backend bundles are available?
</a></h2>
<p>
Current backend bundles are -
</p>
<ul>
<li>
ECPG - a bundle using the embedded SQL interface for
postgres. <br /> This is based on a similar
code which was in production use for over eighteen
months, so it should be reliable, but
inefficient.
</li>
<li>
Postgres - a bundle using the libpq native
interface for postgres. <br /> This is the
preferred backend as it allows 'SELECT FOR
UPDATE', which the ECPG backend cannot support
due to limitations in the postgres implementation of
cursors. The code is now well tested and known
to be efficient.
</li>
<li>
MySQL - a bundle using the mysqlclient library for
*recent* MySQL. <br /> I don't use MySQL... but
the test program ran successfully with a vanilla
install of the MySQL packages for recent Debian
unstable.
</li>
<li>
SQLite - a bundle using the sqlite3 library which
supports an SQL-like API for direct access to a
database file (rather than acting as a client of
a database server process). <br /> Not as functional as
the other backends (doesn't support dates for
instance), but good enough for many purposes
and very 'lightweight'. See http://www.sqlite.org
</li>
<li>
Oracle - a bundle using embedded SQL for Oracle.
<br /> Completely untested... may even need some
work to compile... but this *is* based on code which
was working about a year ago. <br /> No support for
BLOBs yet.
</li>
</ul>
<h2><a name="001003000000">
Where can you get it? How can you install it?
</a></h2>
<p>
The SQLClient library is currently only available via
CVS from the GNUstep CVS repository. <br /> See
<https://savannah.gnu.org/cvs/?group=gnustep>
<br /> You need to check out
<code>gnustep/dev-libs/SQLClient</code>
</p>
<p>
To build this library you must have a basic GNUstep
environment set up...
</p>
<ul>
<li>
The gnustep-make package must have been built and
installed.
</li>
<li>
The gnustep-base package must have been built and
installed.
</li>
<li>
The Performance library (from the dev-libs area in
GNUstep CVS) must have been built and installed.
</li>
<li>
If this environment is in place, all you should need
to do is run 'make' to configure and build the
library, 'make install' to install it.
</li>
<li>
Then you can run the test programs.
</li>
<li>
Your most likely problems are that the configure
script may not detect the database libraries you
want... Please figure out how to modify
<code>configure.ac</code> so that it will detect
the required headers and libraries on your system,
and supply na patch.
</li>
<li>
Once the library is installed, you can include the
header file
<code><SQLClient/SQLClient.h%gt;</code> and
link your programs with the <code>SQLClient</code>
library to use it.
</li>
</ul>
<p>
Bug reports, patches, and contributions (eg a backend
bundle for a new database) should be entered on the
GNUstep project page
<http://savannah.gnu.org/projects/gnustep>
and the bug reporting page
<http://savannah.gnu.org/bugs/?group=gnustep>
</p>
<h1><a name="002000000000">
Software documentation for the SQLClient class
</a></h1>
<h2><a name="class$SQLClient">SQLClient</a> : NSObject</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>SQLClient.h</dd>
</dl>
</blockquote>
<div class="desc">
</p>
<p>
The SQLClient class encapsulates dynamic SQL access to
relational database systems. A shared instance
of the class is used for each database (as identified by
the name of the database), and the number of
simultanous database connections is managed
too.
</p>
<p>
</p>
<p>
SQLClient is an abstract base class... when you
create an instance of it, you are actually creating
an instance of a concrete subclass whose implementation
is loaded from a bundle.
</p>
<p>
</div>
<hr width="50%" align="left" />
<a href="#_SQLClient_ivars">Instance Variables</a>
<br/><br/>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-cache">-cache</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-cache$query$,...">-cache:query:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-cache$query$with$">-cache:query:with:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-cache$simpleQuery$">-cache:simpleQuery:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-cache$simpleQuery$recordType$listType$">-cache:simpleQuery:recordType:listType:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-setCache$">-setCache:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-setCacheThread$">-setCacheThread:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Convenience)-batch$">-batch:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Convenience)-columns$">-columns:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Convenience)-queryRecord$,...">-queryRecord:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Convenience)-queryString$,...">-queryString:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Convenience)-singletons$">-singletons:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Convenience)-transaction">-transaction</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)+debugging">+debugging</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)+durationLogging">+durationLogging</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)+setDebugging$">+setDebugging:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)+setDurationLogging$">+setDurationLogging:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)-debug$,...">-debug:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)-debugging">-debugging</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)-durationLogging">-durationLogging</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)-setDebugging$">-setDebugging:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)-setDurationLogging$">-setDurationLogging:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Notifications)-addObserver$selector$name$">-addObserver:selector:name:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Notifications)-postNotificationName$payload$">-postNotificationName:payload:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Notifications)-removeObserver$name$">-removeObserver:name:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendConnect">-backendConnect</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendDisconnect">-backendDisconnect</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendExecute$">-backendExecute:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendListen$">-backendListen:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendNotify$payload$">-backendNotify:payload:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendQuery$">-backendQuery:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendQuery$recordType$listType$">-backendQuery:recordType:listType:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendUnlisten$">-backendUnlisten:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-copyEscapedBLOB$into$">-copyEscapedBLOB:into:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-insertBLOBs$intoStatement$length$withMarker$length$giving$">-insertBLOBs:intoStatement:length:withMarker:length:giving:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-lengthOfEscapedBLOB$">-lengthOfEscapedBLOB:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient+allClients">+allClients</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient+clientWithConfiguration$name$">+clientWithConfiguration:name:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient+existingClient$">+existingClient:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient+maxConnections">+maxConnections</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient+purgeConnections$">+purgeConnections:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient+setMaxConnections$">+setMaxConnections:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-begin">-begin</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-buildQuery$,...">-buildQuery:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-buildQuery$with$">-buildQuery:with:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-clientName">-clientName</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-commit">-commit</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-connect">-connect</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-connected">-connected</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-database">-database</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-disconnect">-disconnect</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-execute$,...">-execute:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-execute$with$">-execute:with:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-initWithConfiguration$">-initWithConfiguration:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-initWithConfiguration$name$">-initWithConfiguration:name:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-isEqual$">-isEqual:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-isInTransaction">-isInTransaction</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-lastOperation">-lastOperation</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-name">-name</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-password">-password</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-query$,...">-query:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-query$with$">-query:with:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-quote$">-quote:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-quoteBigInteger$">-quoteBigInteger:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-quoteCString$">-quoteCString:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-quoteChar$">-quoteChar:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-quoteFloat$">-quoteFloat:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-quoteInteger$">-quoteInteger:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-quoteString$">-quoteString:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-quotef$,...">-quotef:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-rollback">-rollback</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-setDatabase$">-setDatabase:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-setName$">-setName:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-setPassword$">-setPassword:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-setShouldTrim$">-setShouldTrim:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-setUser$">-setUser:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-simpleExecute$">-simpleExecute:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-simpleQuery$">-simpleQuery:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-simpleQuery$recordType$listType$">-simpleQuery:recordType:listType:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient-user">-user</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$SQLClient+allClients">allClients </a></h3>
+ (NSArray*) <b>allClients</b>;<br />
<div class="desc">
Returns an array containing all the SQLClient
instances.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient+clientWithConfiguration$name$">clientWithConfiguration: name: </a></h3>
+ (<a rel="gsdoc" href="#class$SQLClient">SQLClient</a>*) <b>clientWithConfiguration:</b> (NSDictionary*)config<b> name:</b> (NSString*)reference;<br />
<div class="desc">
Return an existing SQLClient instance (using
+existingClient:) if possible, or creates
one, initialises it using
<a rel="gsdoc" href="#method$SQLClient-initWithConfiguration$name$">
-initWithConfiguration:name:
</a>
, and returns the new instance (autoreleased). <br />
Returns <code>nil</code> on failure.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient+existingClient$">existingClient: </a></h3>
+ (<a rel="gsdoc" href="#class$SQLClient">SQLClient</a>*) <b>existingClient:</b> (NSString*)reference;<br />
<div class="desc">
Return an existing SQLClient instance for the
specified name if one exists, otherwise returns
<code>nil</code>.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient+maxConnections">maxConnections </a></h3>
+ (unsigned int) <b>maxConnections</b>;<br />
<div class="desc">
Return the maximum number of simultaneous database
connections permitted (set by
<a rel="gsdoc" href="#method$SQLClient+setMaxConnections$">
+setMaxConnections:
</a>
and defaults to 8)
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient+purgeConnections$">purgeConnections: </a></h3>
+ (void) <b>purgeConnections:</b> (NSDate*)since;<br />
<div class="desc">
</p>
<p>
Use this method to reduce the number of database
connections currently active so that it is
less than the limit set by the
<a rel="gsdoc" href="#method$SQLClient+setMaxConnections$">
+setMaxConnections:
</a>
method. This mechanism is used internally by the
class to ensure that, when it is about to open a
new connection, the limit is not exceeded.
</p>
<p>
</p>
<p>
If <var>since</var> is not <code>nil</code>, then any
connection which has not been used more
recently than that date is disconnected anyway.
<br /> You can (and probably should) use this
periodically to purge idle connections, but
you can also pass a date in the future to close all
connections.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient+setMaxConnections$">setMaxConnections: </a></h3>
+ (void) <b>setMaxConnections:</b> (unsigned int)c;<br />
<div class="desc">
</p>
<p>
Set the maximum number of simultaneous database
connections permitted (defaults to 8 and may
not be set less than 1).
</p>
<p>
</p>
<p>
This value is used by the
<a rel="gsdoc" href="#method$SQLClient+purgeConnections$">
+purgeConnections:
</a>
method to determine how many connections should be
disconnected when it is called.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-begin">begin </a></h3>
- (void) <b>begin</b>;<br />
<div class="desc">
Start a transaction for this database client. <br />
You <strong>must</strong> match this with either a
<a rel="gsdoc" href="#method$SQLClient-commit">
-commit
</a>
or a <a rel="gsdoc" href="#method$SQLClient-rollback">-rollback</a>
.
<br />
</p>
<p>
Normally, if you execute an SQL statement
without using this method first, the
<em>autocommit</em> feature is employed, and the
statement takes effect immediately. Use of this
method permits you to execute several statements
in sequence, and only have them take effect (as a
single operation) when you call the
<a rel="gsdoc" href="#method$SQLClient-commit">
-commit
</a>
method.
</p>
<p>
</p>
<p>
NB. You must <strong>not</strong> execute an SQL
statement which would start a transaction
directly... use only this method.
</p>
<p>
</p>
<p>
Where possible, consider using the
<a rel="gsdoc" href="#class$SQLTransaction">SQLTransaction</a>
class rather than calling <a rel="gsdoc" href="#method$SQLClient-begin">-begin</a>
<a rel="gsdoc" href="#method$SQLClient-commit">-commit</a>
or <a rel="gsdoc" href="#method$SQLClient-rollback">-rollback</a>
yourself. </p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-buildQuery$,...">buildQuery: ,...</a></h3>
- (NSString*) <b>buildQuery:</b> (NSString*)stmt<b>,...</b>;<br />
<div class="desc">
</p>
<p>
Build an sql query string using the supplied
arguments.
</p>
<p>
</p>
<p>
This method has at least one argument, the string
starting the query to be executed (which must
have the prefix 'select ').
</p>
<p>
</p>
<p>
Additional arguments are a <code>nil</code>
terminated list which also be strings, and
these are appended to the statement. <br /> Any
string arguments are assumed to have been quoted
appropriately already, but non-string
arguments are automatically quoted using the
<a rel="gsdoc" href="#method$SQLClient-quote$">
-quote:
</a>
method.
</p>
<p>
<pre>
sql = [db buildQuery: @"SELECT Name FROM ", table, nil];
</pre>
</p>
<p>
Upon error, an exception is raised.
</p>
<p>
</p>
<p>
The method returns a string containing sql suitable
for passing to the
<a rel="gsdoc" href="#method$SQLClient-simpleQuery$recordType$listType$">-simpleQuery:recordType:listType:</a>
or <a rel="gsdoc" href="#method$SQLClient(Caching)-cache$simpleQuery$recordType$listType$">-cache:simpleQuery:recordType:listType:</a>
methods.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-buildQuery$with$">buildQuery: with: </a></h3>
- (NSString*) <b>buildQuery:</b> (NSString*)stmt<b> with:</b> (NSDictionary*)values;<br />
<div class="desc">
Takes the query statement and substitutes in
<var>values</var> from the dictionary where markup of
the format {key} is found. <br /> Returns the resulting
query string.
<pre>
sql = [db buildQuery: @"SELECT Name FROM {Table} WHERE ID = {ID}"
with: values];
</pre>
</p>
<p>
Any non-string <var>values</var> in the dictionary
will be replaced by the results of the
<a rel="gsdoc" href="#method$SQLClient-quote$">
-quote:
</a>
method. <br /> The markup format may also be
{key?default} where <em>default</em> is a
string to be used if there is no value for the
<em>key</em> in the dictionary.
</p>
<p>
</p>
<p>
The method returns a string containing sql suitable
for passing to the
<a rel="gsdoc" href="#method$SQLClient-simpleQuery$recordType$listType$">-simpleQuery:recordType:listType:</a>
or <a rel="gsdoc" href="#method$SQLClient(Caching)-cache$simpleQuery$recordType$listType$">-cache:simpleQuery:recordType:listType:</a>
methods.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-clientName">clientName </a></h3>
- (NSString*) <b>clientName</b>;<br />
<div class="desc">
Return the client name for this instance. <br />
Normally this is useful only for
debugging/reporting purposes, but if
you are using multiple instances of this class in your
application, and you are using embedded SQL,
you will need to use this method to fetch the
client/connection name and store its
C-string representation in a variable
'connectionName' declared to the sql
preprocessor, so you can then have statements
of the form - 'exec sql at :connectionName...'.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-commit">commit </a></h3>
- (void) <b>commit</b>;<br />
<div class="desc">
Complete a transaction for this database client.
<br /> This <strong>must</strong> match an earlier
<a rel="gsdoc" href="#method$SQLClient-begin">
-begin
</a>
.
</p>
<p>
NB. You must <strong>not</strong> execute an SQL
statement which would commit or rollback a
transaction directly... use only this method
or the
<a rel="gsdoc" href="#method$SQLClient-rollback">
-rollback
</a>
method.
</p>
<p>
</p>
<p>
Where possible, consider using the
<a rel="gsdoc" href="#class$SQLTransaction">SQLTransaction</a>
class rather than calling <a rel="gsdoc" href="#method$SQLClient-begin">-begin</a>
<a rel="gsdoc" href="#method$SQLClient-commit">-commit</a>
or <a rel="gsdoc" href="#method$SQLClient-rollback">-rollback</a>
yourself. </p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-connect">connect </a></h3>
- (BOOL) <b>connect</b>;<br />
<div class="desc">
If the <em>connected</em> instance variable is
<code>NO</code>, this method calls
<a rel="gsdoc" href="#method$SQLClient(Subclass)-backendConnect">
-backendConnect
</a>
to ensure that there is a connection to the database
server established. Returns the result. <br />
Performs any necessary locking for thread safety.
<br /> This method also counts the number of
consecutive failed connection attempts. A delay
is enforced between each connection attempt, with the
length of the delay growing with each failure. This
ensures that applications which fail to deal with
connection failures, and just keep trying to
reconnect, will not overload the system/server.
<br /> The maximum delay is 30 seconds, so when the
database server is restarted, the application can
reconnect reasonably quickly.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-connected">connected </a></h3>
- (BOOL) <b>connected</b>;<br />
<div class="desc">
Return a flag to say whether a connection to the
database server is currently live. This is mostly
useful for debug/reporting, but is used internally
to keep track of active connections.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-database">database </a></h3>
- (NSString*) <b>database</b>;<br />
<div class="desc">
Return the database name for this instance (or
<code>nil</code>).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-disconnect">disconnect </a></h3>
- (void) <b>disconnect</b>;<br />
<div class="desc">
If the <em>connected</em> instance variable is
<code>YES</code>, this method calls
<a rel="gsdoc" href="#method$SQLClient(Subclass)-backendDisconnect">
-backendDisconnect
</a>
to ensure that the connection to the database server is
dropped. <br /> Performs any necessary locking for
thread safety.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-execute$,...">execute: ,...</a></h3>
- (NSInteger) <b>execute:</b> (NSString*)stmt<b>,...</b>;<br />
<div class="desc">
Perform arbitrary operation
<em>which does not return any value.</em> <br /> This
arguments to this method are a <code>nil</code>
terminated list which are concatenated in the
manner of the
<a rel="gsdoc" href="#method$SQLClient-query$,...">
-query:,...
</a>
method. <br /> Any string arguments are assumed to
have been quoted appropriately already, but non-string
arguments are automatically quoted using the
<a rel="gsdoc" href="#method$SQLClient-quote$">
-quote:
</a>
method.
<pre>
[db execute: @"UPDATE ", table, @" SET Name = ",
myName, " WHERE ID = ", myId, nil];
</pre>
Where the database backend support it, this method
returns the count of the number of rows to which
the operation applied. Otherwise this returns -1.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-execute$with$">execute: with: </a></h3>
- (NSInteger) <b>execute:</b> (NSString*)stmt<b> with:</b> (NSDictionary*)values;<br />
<div class="desc">
Takes the statement and substitutes in
<var>values</var> from the dictionary where markup of
the format {key} is found. <br /> Passes the result to
the
<a rel="gsdoc" href="#method$SQLClient-execute$,...">
-execute:,...
</a>
method.
<pre>
[db execute: @"UPDATE {Table} SET Name = {Name} WHERE ID = {ID}"
with: values];
</pre>
Any non-string <var>values</var> in the dictionary will
be replaced by the results of the
<a rel="gsdoc" href="#method$SQLClient-quote$">
-quote:
</a>
method. <br /> The markup format may also be
{key?default} where <em>default</em> is a
string to be used if there is no value for the
<em>key</em> in the dictionary. <br /> Where the
database backend support it, this method returns
the count of the number of rows to which the operation
applied. Otherwise this returns -1.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-initWithConfiguration$">initWithConfiguration: </a></h3>
- (id) <b>initWithConfiguration:</b> (NSDictionary*)config;<br />
<div class="desc">
Calls
<a rel="gsdoc" href="#method$SQLClient-initWithConfiguration$name$">
-initWithConfiguration:name:
</a>
passing a <code>nil</code> reference name.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-initWithConfiguration$name$">initWithConfiguration: name: </a></h3>
- (id) <b>initWithConfiguration:</b> (NSDictionary*)config<b> name:</b> (NSString*)reference;<br />
<div class="desc">
Initialise using the supplied configuration, or
if that is <code>nil</code>, try to use values from
NSUserDefaults (and automatically update
when the defaults change). <br /> Uses the
<var>reference</var> name to determine configuration
information... and if a <code>nil</code> name
is supplied, defaults to the value of SQLClientName in
the configuration dictionary (or in the standard user
defaults). If there is no value for
SQLClientName, uses the string 'Database'.
<br /> If a SQLClient instance already exists with
the name used for this instance, the receiver is
deallocated and the existing instance is
retained and returned... there may only ever be
one instance for a particular <var>reference</var>
name. <br /> <br /> The <var>config</var> argument
(or the SQLClientReferences user default) is a
dictionary with names as keys and dictionaries
as its values. Configuration entries from the dictionary
corresponding to the database client are used
if possible, general entries are used otherwise. <br />
Database... is the name of the database to use, if
it is missing then 'Database' may be used instead.
<br /> User... is the name of the database user to
use, if it is missing then 'User' may be used instead.
<br /> Password... is the name of the database user
password, if it is missing then 'Password' may be
used instead. <br /> ServerType... is the name of the
backend server to be used... by convention the name
of a bundle containing the interface to that backend. If
this is missing then 'Postgres' is used. <br /> The
database name may be of the format
'name@host:port' when you wish to connect
to a database on a different host over the network.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-isEqual$">isEqual: </a></h3>
- (BOOL) <b>isEqual:</b> (id)other;<br />
<div class="desc">
Two clients are considered equal if they refer to the
same database and are logged in as the same database
user using the same protocol. These are the general
criteria for transactions to be compatoible so
that an SQLTransaction object generated by one client
can be used by the <var>other</var>.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-isInTransaction">isInTransaction </a></h3>
- (BOOL) <b>isInTransaction</b>;<br />
<div class="desc">
Return the state of the flag indicating whether the
library thinks a transaction is in progress. This
flag is normally maintained by
<a rel="gsdoc" href="#method$SQLClient-begin">
-begin
</a>
, <a rel="gsdoc" href="#method$SQLClient-commit">-commit</a>
, and
<a rel="gsdoc" href="#method$SQLClient-rollback">
-rollback
</a>
.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-lastOperation">lastOperation </a></h3>
- (NSDate*) <b>lastOperation</b>;<br />
<div class="desc">
Returns the date/time stamp of the last database
operation performed by the receiver, or
<code>nil</code> if no operation has ever been done
by it. <br /> Simply connecting to or disconnecting from
the databsse does not count as an operation.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-name">name </a></h3>
- (NSString*) <b>name</b>;<br />
<div class="desc">
Return the database reference name for this instance
(or <code>nil</code>).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-password">password </a></h3>
- (NSString*) <b>password</b>;<br />
<div class="desc">
Return the database password for this instance (or
<code>nil</code>).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-query$,...">query: ,...</a></h3>
- (NSMutableArray*) <b>query:</b> (NSString*)stmt<b>,...</b>;<br />
<div class="desc">
</p>
<p>
Perform arbitrary query
<em>which returns values.</em>
</p>
<p>
</p>
<p>
This method handles its arguments in the same way as
the
<a rel="gsdoc" href="#method$SQLClient-buildQuery$,...">
-buildQuery:,...
</a>
method and returns the result of the query.
</p>
<p>
<pre>
result = [db query: @"SELECT Name FROM ", table, nil];
</pre>
</p>
<p>
Upon error, an exception is raised.
</p>
<p>
</p>
<p>
The query returns an array of records (each of which
is represented by an SQLRecord object).
</p>
<p>
</p>
<p>
Each SQLRecord object contains one or more fields,
in the order in which they occurred in the query.
Fields may also be retrieved by name.
</p>
<p>
</p>
<p>
NULL field items are returned as NSNull objects.
</p>
<p>
</p>
<p>
Most other field items are returned as NSString
objects.
</p>
<p>
</p>
<p>
Date and timestamp field items are returned as
NSDate objects.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-query$with$">query: with: </a></h3>
- (NSMutableArray*) <b>query:</b> (NSString*)stmt<b> with:</b> (NSDictionary*)values;<br />
<div class="desc">
Takes the query statement and substitutes in
<var>values</var> from the dictionary (in the same
manner as the
<a rel="gsdoc" href="#method$SQLClient-buildQuery$with$">
-buildQuery:with:
</a>
method) then executes the query and returns the
response. <br />
<pre>
result = [db query: @"SELECT Name FROM {Table} WHERE ID = {ID}"
with: values];
</pre>
Any non-string <var>values</var> in the dictionary will
be replaced by the results of the
<a rel="gsdoc" href="#method$SQLClient-quote$">
-quote:
</a>
method. <br /> The markup format may also be
{key?default} where <em>default</em> is a
string to be used if there is no value for the
<em>key</em> in the dictionary.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-quote$">quote: </a></h3>
- (NSString*) <b>quote:</b> (id)obj;<br />
<div class="desc">
Convert an object to a string suitable for use in
an SQL query. <br /> Normally the
<a rel="gsdoc" href="#method$SQLClient-execute$,...">
-execute:,...
</a>
, and
<a rel="gsdoc" href="#method$SQLClient-query$,...">
-query:,...
</a>
methods will call this method automatically for
everything apart from string objects. <br />
Strings have to be handled specially, because they
are used both for parts of the SQL command, and as
values (where they need to be quoted). So where you
need to pass a string value which needs quoting, you
must call this method explicitly. <br /> Subclasses
may override this method to provide appropriate quoting
for types of object which need database backend
specific quoting conventions. However, the defalt
implementation should be OK for most cases.
<br /> This method makes use of
<a rel="gsdoc" href="#method$SQLClient-quoteString$">
-quoteString:
</a>
to quote literal strings. <br /> The base class
implementation formats NSDate objects as
<br /> YYYY-MM-DD hh:mm:ss.mmm ?ZZZZ <br /> NSData
objects are not quoted... they must not appear in
queries, and where used for insert/update
operations, they need to be passed to the
<a rel="gsdoc" href="#method$SQLClient(Subclass)-backendExecute$">
-backendExecute:
</a>
method unchanged. <br /> For a <code>nil</code>
object, we return NULL. <br /> For a number, we
simply convert directly to a string. <br /> For a
date, we convert to the text format used by the
database, and add leading and trailing quotes.
<br /> For a data object, we don't quote... the
other parts of the code need to know they have an
NSData object and pass it on unchanged to the
<a rel="gsdoc" href="#method$SQLClient(Subclass)-backendExecute$">
-backendExecute:
</a>
method. <br /> Just in case an NSNull subclass has
been created by someone. The normal NSNull instance
should have been handled earlier. <br /> For an
NSArray or NSSet, we produce a bracketed list of
the (quoted) objects in the array. <br /> For any other
type of data, we just produce a quoted string
representation of the objects description.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-quoteBigInteger$">quoteBigInteger: </a></h3>
- (NSString*) <b>quoteBigInteger:</b> (int64_t)i;<br />
<div class="desc">
Convert a big (64 bit) integer to a string suitable
for use in an SQL query.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-quoteCString$">quoteCString: </a></h3>
- (NSString*) <b>quoteCString:</b> (const char*)s;<br />
<div class="desc">
Convert a 'C' string to a string suitable for use
in an SQL query by using
<a rel="gsdoc" href="#method$SQLClient-quoteString$">
-quoteString:
</a>
to convert it to a literal string format. <br /> NB. a
null pointer is treated as an empty string.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-quoteChar$">quoteChar: </a></h3>
- (NSString*) <b>quoteChar:</b> (char)c;<br />
<div class="desc">
Convert a single character to a string suitable for
use in an SQL query by using
<a rel="gsdoc" href="#method$SQLClient-quoteString$">
-quoteString:
</a>
to convert it to a literal string format. <br /> NB. a
nul character is not allowed and will cause an
exception.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-quoteFloat$">quoteFloat: </a></h3>
- (NSString*) <b>quoteFloat:</b> (float)f;<br />
<div class="desc">
Convert a <strong>float</strong> to a string
suitable for use in an SQL query.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-quoteInteger$">quoteInteger: </a></h3>
- (NSString*) <b>quoteInteger:</b> (int)i;<br />
<div class="desc">
Convert an integer to a string suitable for use in
an SQL query.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-quoteString$">quoteString: </a></h3>
- (NSString*) <b>quoteString:</b> (NSString*)s;<br />
<div class="desc">
Convert a string to a form suitable for use as a
string literal in an SQL query. <br /> Subclasses
may override this for non-standard literal string
quoting conventions.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-quotef$,...">quotef: ,...</a></h3>
- (NSString*) <b>quotef:</b> (NSString*)fmt<b>,...</b>;<br />
<div class="desc">
Produce a quoted string from the supplied arguments
(printf style).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-rollback">rollback </a></h3>
- (void) <b>rollback</b>;<br />
<div class="desc">
Revert a transaction for this database client.
<br /> If there is no transaction in progress, this
method does nothing. <br />
</p>
<p>
NB. You must <strong>not</strong> execute an SQL
statement which would commit or rollback a
transaction directly... use only this method
or the
<a rel="gsdoc" href="#method$SQLClient-rollback">
-rollback
</a>
method.
</p>
<p>
</p>
<p>
Where possible, consider using the
<a rel="gsdoc" href="#class$SQLTransaction">SQLTransaction</a>
class rather than calling <a rel="gsdoc" href="#method$SQLClient-begin">-begin</a>
<a rel="gsdoc" href="#method$SQLClient-commit">-commit</a>
or <a rel="gsdoc" href="#method$SQLClient-rollback">-rollback</a>
yourself. </p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-setDatabase$">setDatabase: </a></h3>
- (void) <b>setDatabase:</b> (NSString*)s;<br />
<div class="desc">
Set the database host/name for this object. <br /> This
is called automatically to configure the connection...
you normally shouldn't need to call it yourself.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-setName$">setName: </a></h3>
- (void) <b>setName:</b> (NSString*)s;<br />
<div class="desc">
Set the database reference name for this object. This
is used to differentiate between multiple connections to
the database. <br /> This is called automatically to
configure the connection... you normally
shouldn't need to call it yourself. <br /> NB.
attempts to change the name of an instance to that
of an existing instance are ignored.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-setPassword$">setPassword: </a></h3>
- (void) <b>setPassword:</b> (NSString*)s;<br />
<div class="desc">
Set the database password for this object. <br /> This
is called automatically to configure the connection...
you normally shouldn't need to call it yourself.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-setShouldTrim$">setShouldTrim: </a></h3>
- (void) <b>setShouldTrim:</b> (BOOL)aFlag;<br />
<div class="desc">
Sets an internal flag to indicate whether leading and
trailing white space characters should be removed
from values retrieved from the database by the
receiver.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-setUser$">setUser: </a></h3>
- (void) <b>setUser:</b> (NSString*)s;<br />
<div class="desc">
Set the database user for this object. <br /> This is
called automatically to configure the connection...
you normally shouldn't need to call it yourself.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-simpleExecute$">simpleExecute: </a></h3>
- (NSInteger) <b>simpleExecute:</b> (NSArray*)info;<br />
<div class="desc">
Calls
<a rel="gsdoc" href="#method$SQLClient(Subclass)-backendExecute$">
-backendExecute:
</a>
in a safe manner. <br /> Handles locking. <br />
Maintains
<a rel="gsdoc" href="#method$SQLClient-lastOperation">
-lastOperation
</a>
date. <br /> Returns the result of
<a rel="gsdoc" href="#method$SQLClient(Subclass)-backendExecute$">
-backendExecute:
</a>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-simpleQuery$">simpleQuery: </a></h3>
- (NSMutableArray*) <b>simpleQuery:</b> (NSString*)stmt;<br />
<div class="desc">
Calls
<a rel="gsdoc" href="#method$SQLClient-simpleQuery$recordType$listType$">
-simpleQuery:recordType:listType:
</a>
with the default record class and default array class.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-simpleQuery$recordType$listType$">simpleQuery: recordType: listType: </a></h3>
- (NSMutableArray*) <b>simpleQuery:</b> (NSString*)stmt<b> recordType:</b> (id)rtype<b> listType:</b> (id)ltype;<br />
<div class="desc">
Calls
<a rel="gsdoc" href="#method$SQLClient(Subclass)-backendQuery$recordType$listType$">-backendQuery:recordType:listType:</a>
in a safe manner. <br /> Handles locking. <br /> Maintains <a rel="gsdoc" href="#method$SQLClient-lastOperation">-lastOperation</a>
date. <br /> The value of <var>rtype</var> must respond to the <a rel="gsdoc" href="#method$SQLRecord+newWithValues$keys$count$">[SQLRecord +newWithValues:keys:count:]</a>
method. <br /> If <var>rtype</var> is <code>nil</code> then the
<a rel="gsdoc" href="#class$SQLRecord">SQLRecord</a>
class is used. <br /> The value of <var>ltype</var>
must respond to the
[NSObject +alloc]
method to produce a container which must repond to
the
[NSMutableArray -initWithCapacity:]
method to initialise itsself and the [NSMutableArray -addObject:]
method to add records to the list. <br /> If <var>ltype</var> is <code>nil</code> then the
NSMutableArray
class is used. <br /> This library provides a few
helper classes to provide alternative values for
<var>rtype</var> and <var>ltype</var>.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient-user">user </a></h3>
- (NSString*) <b>user</b>;<br />
<div class="desc">
Return the database user for this instance (or
<code>nil</code>).
</div>
<hr width="25%" align="left" />
</div>
<a name="_SQLClient_ivars"/> <br/><hr width="50%" align="left" />
<h2>Instance Variables for SQLClient Class</h2>
<h3><a name="ivariable$SQLClient*_cache">_cache</a></h3>
@protected GSCache* <b>_cache</b>;<br />
<div class="desc">
The cache for query results <br /> <em>Warning</em> the
underscore at the start of the name of this
instance variable indicates that, even though it
is not technically <em>private</em>, it is intended for
internal use within the package, and you should
not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_cacheThread">_cacheThread</a></h3>
@protected NSThread* <b>_cacheThread</b>;<br />
<div class="desc">
Thread for cache queries <br /> <em>Warning</em> the
underscore at the start of the name of this
instance variable indicates that, even though it
is not technically <em>private</em>, it is intended for
internal use within the package, and you should
not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_client">_client</a></h3>
@protected NSString* <b>_client</b>;<br />
<div class="desc">
Identifier within backend <br />
<em>Warning</em> the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically <em>private</em>, it is
intended for internal use within the package, and
you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_connectFails">_connectFails</a></h3>
@protected unsigned int <b>_connectFails</b>;<br />
<div class="desc">
The count of connection failures <br />
<em>Warning</em> the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically <em>private</em>, it is
intended for internal use within the package, and
you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_database">_database</a></h3>
@protected NSString* <b>_database</b>;<br />
<div class="desc">
The configured database name/host <br />
<em>Warning</em> the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically <em>private</em>, it is
intended for internal use within the package, and
you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_debugging">_debugging</a></h3>
@protected unsigned int <b>_debugging</b>;<br />
<div class="desc">
The current debugging level <br /> <em>Warning</em> the
underscore at the start of the name of this
instance variable indicates that, even though it
is not technically <em>private</em>, it is intended for
internal use within the package, and you should
not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_duration">_duration</a></h3>
@protected NSTimeInterval <b>_duration</b>;<br />
<div class="desc">
<em>Warning</em> the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically <em>private</em>, it is
intended for internal use within the package, and
you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_extra">_extra</a></h3>
@protected void* <b>_extra</b>;<br />
<div class="desc">
Allow for extensions by allocating memory and
pointing to it from the _extra ivar. That way we
can avoid binary incompatibility between minor
releases. <br /> <em>Warning</em> the underscore
at the start of the name of this instance variable
indicates that, even though it is not technically
<em>private</em>, it is intended for internal use
within the package, and you should not use the
variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_inTransaction">_inTransaction</a></h3>
@protected BOOL <b>_inTransaction</b>;<br />
<div class="desc">
A flag indicating whether this instance is currently
within a transaction. This variable must
<em>only</em> be set by the
<a rel="gsdoc" href="#method$SQLClient-begin">
-begin
</a>
, <a rel="gsdoc" href="#method$SQLClient-commit">-commit</a>
or
<a rel="gsdoc" href="#method$SQLClient-rollback">
-rollback
</a>
methods. <br /> Are we inside a transaction?
<br /> <em>Warning</em> the underscore at the start
of the name of this instance variable indicates that,
even though it is not technically <em>private</em>, it
is intended for internal use within the package, and you
should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_lastOperation">_lastOperation</a></h3>
@protected NSTimeInterval <b>_lastOperation</b>;<br />
<div class="desc">
Timestamp of last operation. <br /> Maintained by
<a rel="gsdoc" href="#method$SQLClient-simpleExecute$">
-simpleExecute:
</a>
<a rel="gsdoc" href="#method$SQLClient-simpleQuery$recordType$listType$">
-simpleQuery:recordType:listType:
</a>
and
<a rel="gsdoc" href="#method$SQLClient(Caching)-cache$simpleQuery$recordType$listType$">-cache:simpleQuery:recordType:listType:</a>
Also set for a failed connection attempt, but not reported by the <a rel="gsdoc" href="#method$SQLClient-lastOperation">-lastOperation</a>
method in that case. <br /> <em>Warning</em> the underscore at the start of the name of this instance variable indicates that, even though it is not technically <em>private</em>, it is intended for internal use within the package, and you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_name">_name</a></h3>
@protected NSString* <b>_name</b>;<br />
<div class="desc">
Unique identifier for instance <br />
<em>Warning</em> the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically <em>private</em>, it is
intended for internal use within the package, and
you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_names">_names</a></h3>
@protected NSCountedSet* <b>_names</b>;<br />
<div class="desc">
Track notification names <br /> <em>Warning</em> the
underscore at the start of the name of this
instance variable indicates that, even though it
is not technically <em>private</em>, it is intended for
internal use within the package, and you should
not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_observers">_observers</a></h3>
@protected NSMapTable* <b>_observers</b>;<br />
<div class="desc">
Observations of async events <br />
<em>Warning</em> the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically <em>private</em>, it is
intended for internal use within the package, and
you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_password">_password</a></h3>
@protected NSString* <b>_password</b>;<br />
<div class="desc">
The configured password <br /> <em>Warning</em> the
underscore at the start of the name of this
instance variable indicates that, even though it
is not technically <em>private</em>, it is intended for
internal use within the package, and you should
not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_shouldTrim">_shouldTrim</a></h3>
@protected BOOL <b>_shouldTrim</b>;<br />
<div class="desc">
A flag indicating whether leading and trailing white
space in values read from the database should
automatically be removed. <br /> This should
only be modified by the
<a rel="gsdoc" href="#method$SQLClient-setShouldTrim$">
-setShouldTrim:
</a>
method. <br /> Should whitespace be trimmed? <br />
<em>Warning</em> the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically <em>private</em>, it is
intended for internal use within the package, and
you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_statements">_statements</a></h3>
@protected NSMutableArray* <b>_statements</b>;<br />
<div class="desc">
Uncommitted statements <br /> <em>Warning</em>
the underscore at the start of the name of this
instance variable indicates that, even though it
is not technically <em>private</em>, it is intended for
internal use within the package, and you should
not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*_user">_user</a></h3>
@protected NSString* <b>_user</b>;<br />
<div class="desc">
The configured user <br /> <em>Warning</em> the
underscore at the start of the name of this
instance variable indicates that, even though it
is not technically <em>private</em>, it is intended for
internal use within the package, and you should
not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*connected">connected</a></h3>
@protected BOOL <b>connected</b>;<br />
<div class="desc">
A flag indicating whether this instance is currently
connected to the backend database server. This
variable must <em>only</em> be set by the
<a rel="gsdoc" href="#method$SQLClient(Subclass)-backendConnect">
-backendConnect
</a>
or
<a rel="gsdoc" href="#method$SQLClient(Subclass)-backendDisconnect">
-backendDisconnect
</a>
methods.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*extra">extra</a></h3>
@protected void* <b>extra</b>;<br />
<div class="desc">
For subclass specific data
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLClient*lock">lock</a></h3>
@protected NSRecursiveLock* <b>lock</b>;<br />
<div class="desc">
Maintain thread-safety
</div>
<hr width="25%" align="left" />
<br/><hr width="50%" align="left" /><br/>
<h1><a name="003000000000">
Software documentation for the SQLDictionaryBuilder
class
</a></h1>
<h2><a name="class$SQLDictionaryBuilder">SQLDictionaryBuilder</a> : NSObject</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>SQLClient.h</dd>
</dl>
</blockquote>
<div class="desc">
<em>Description forthcoming.</em>
</div>
<hr width="50%" align="left" />
<a href="#_SQLDictionaryBuilder_ivars">Instance Variables</a>
<br/><br/>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLDictionaryBuilder-addObject$">-addObject:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLDictionaryBuilder-alloc">-alloc</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLDictionaryBuilder-content">-content</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLDictionaryBuilder-initWithCapacity$">-initWithCapacity:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLDictionaryBuilder-mutableCopyWithZone$">-mutableCopyWithZone:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLDictionaryBuilder-newWithValues$keys$count$">-newWithValues:keys:count:</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$SQLDictionaryBuilder-addObject$">addObject: </a></h3>
- (void) <b>addObject:</b> (id)anObject;<br />
<div class="desc">
No need to do anything... the object will already have
been added by the
<a rel="gsdoc" href="#method$SQLDictionaryBuilder-newWithValues$keys$count$">
-newWithValues:keys:count:
</a>
method.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLDictionaryBuilder-alloc">alloc </a></h3>
- (id) <b>alloc</b>;<br />
<div class="desc">
When a container is supposed to be allocated, we just
return the receiver (which will then quietly ignore
<a rel="gsdoc" href="#method$SQLDictionaryBuilder-addObject$">
-addObject:
</a>
messages).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLDictionaryBuilder-content">content </a></h3>
- (NSMutableDictionary*) <b>content</b>;<br />
<div class="desc">
Returns the content dictionary for the receiver.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLDictionaryBuilder-initWithCapacity$">initWithCapacity: </a></h3>
- (id) <b>initWithCapacity:</b> (<a rel="gsdoc" href="/usr/share/GNUstep/Documentation/Performance/GSLinkedList.html#type$NSUInteger">NSUInteger</a>)capacity;<br />
<div class="desc">
Creates a new content dictionary... this method
will be called automatically by the SQLClient object
when it performs a query, so there is no need to call
it at any other time.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLDictionaryBuilder-mutableCopyWithZone$">mutableCopyWithZone: </a></h3>
- (id) <b>mutableCopyWithZone:</b> (NSZone*)aZone;<br />
<div class="desc">
Makes a mutable copy of the content dictionary
(called when a caching query uses this helper to
produce the cached collection).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLDictionaryBuilder-newWithValues$keys$count$">newWithValues: keys: count: </a></h3>
- (id) <b>newWithValues:</b> (id*)values<b> keys:</b> (NSString**)keys<b> count:</b> (unsigned int)count;<br />
<div class="desc">
This is the main workhorse of the class... it is
called once for every record read from the database,
and is responsible for adding that record to the
content dictionary. The default implementation,
instead of creating an object to hold the supplied
record data, uses the two fields from the record as
a key-value pair to add to the content dictionary, and
returns <code>nil</code> as the record object. It's
OK to return a <code>nil</code> object since we ignore
the
<a rel="gsdoc" href="#method$SQLDictionaryBuilder-addObject$">
-addObject:
</a>
argument.
</div>
<hr width="25%" align="left" />
</div>
<a name="_SQLDictionaryBuilder_ivars"/> <br/><hr width="50%" align="left" />
<h2>Instance Variables for SQLDictionaryBuilder Class</h2>
<h3><a name="ivariable$SQLDictionaryBuilder*content">content</a></h3>
@protected NSMutableDictionary* <b>content</b>;<br />
<div class="desc">
<em>Description forthcoming.</em>
</div>
<hr width="25%" align="left" />
<br/><hr width="50%" align="left" /><br/>
<h1><a name="004000000000">
Software documentation for the SQLRecord class
</a></h1>
<h2><a name="class$SQLRecord">SQLRecord</a> : NSArray</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>SQLClient.h</dd>
</dl>
</blockquote>
<div class="desc">
</p>
<p>
An enhanced array to represent a record returned from a
query. You should <em>NOT</em> try to create
instances of this class except via the
<a rel="gsdoc" href="#method$SQLRecord+newWithValues$keys$count$">
+newWithValues:keys:count:
</a>
method.
</p>
<p>
</p>
<p>
SQLRecord is the abstract base class of a class
cluster. If you wish to subclass it you must
implement the primitive methods
<a rel="gsdoc" href="#method$SQLRecord+newWithValues$keys$count$">
+newWithValues:keys:count:
</a>
<a rel="gsdoc" href="#method$SQLRecord-count">
-count
</a>
<a rel="gsdoc" href="#method$SQLRecord-keyAtIndex$">
-keyAtIndex:
</a>
<a rel="gsdoc" href="#method$SQLRecord-objectAtIndex$">
-objectAtIndex:
</a>
and
<a rel="gsdoc" href="#method$SQLRecord-replaceObjectAtIndex$withObject$">
-replaceObjectAtIndex:withObject:
</a>
</p>
<p>
</p>
<p>
NB. You do not need to use SQLRecord (or a subclass of
it), all you actually need to supply is a class which
responds to the
<a rel="gsdoc" href="#method$SQLRecord+newWithValues$keys$count$">
+newWithValues:keys:count:
</a>
method that the system uses to create new records...
none of the other methods of the SQLRecord class are
used internally by the SQLClient system.
</p>
<p>
</div>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLRecord+newWithValues$keys$count$">+newWithValues:keys:count:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLRecord-allKeys">-allKeys</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLRecord-count">-count</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLRecord-dictionary">-dictionary</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLRecord-getKeys$">-getKeys:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLRecord-getObjects$">-getObjects:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLRecord-keyAtIndex$">-keyAtIndex:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLRecord-objectAtIndex$">-objectAtIndex:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLRecord-objectForKey$">-objectForKey:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLRecord-replaceObjectAtIndex$withObject$">-replaceObjectAtIndex:withObject:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLRecord-setObject$forKey$">-setObject:forKey:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLRecord-sizeInBytes$">-sizeInBytes:</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$SQLRecord+newWithValues$keys$count$">newWithValues: keys: count: </a></h3>
+ (id) <b>newWithValues:</b> (id*)v<b> keys:</b> (NSString**)k<b> count:</b> (unsigned int)c;<br />
<div class="desc">
Create a new SQLRecord containing the specified
fields. <br /> NB. The values and keys are
<em>retained</em> by the record rather than being
copied. <br /> A <code>nil</code> value is
represented by [NSNull null]. <br /> Keys must
be unique string values (case insensitive comparison).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLRecord-allKeys">allKeys </a></h3>
- (NSArray*) <b>allKeys</b>;<br />
<div class="desc">
Returns an array containing the names of all the
fields in the record.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLRecord-count">count </a></h3>
- (<a rel="gsdoc" href="/usr/share/GNUstep/Documentation/Performance/GSLinkedList.html#type$NSUInteger">NSUInteger</a>) <b>count</b>;<br />
<div class="desc">
Returns the number of items in the record. <br />
Subclasses must implement this method.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLRecord-dictionary">dictionary </a></h3>
- (NSMutableDictionary*) <b>dictionary</b>;<br />
<div class="desc">
Return the record as a mutable dictionary with the
keys as the record field names standardised to be
lowercase strings.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLRecord-getKeys$">getKeys: </a></h3>
- (void) <b>getKeys:</b> (id*)buf;<br />
<div class="desc">
Optimised mechanism for retrieving all keys in
order.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLRecord-getObjects$">getObjects: </a></h3>
- (void) <b>getObjects:</b> (id*)buf;<br />
<div class="desc">
Optimised mechanism for retrieving all objects.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLRecord-keyAtIndex$">keyAtIndex: </a></h3>
- (NSString*) <b>keyAtIndex:</b> (<a rel="gsdoc" href="/usr/share/GNUstep/Documentation/Performance/GSLinkedList.html#type$NSUInteger">NSUInteger</a>)index;<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
Returns the key at the specified indes. <br />
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLRecord-objectAtIndex$">objectAtIndex: </a></h3>
- (id) <b>objectAtIndex:</b> (<a rel="gsdoc" href="/usr/share/GNUstep/Documentation/Performance/GSLinkedList.html#type$NSUInteger">NSUInteger</a>)index;<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
Returns the object at the specified indes. <br />
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLRecord-objectForKey$">objectForKey: </a></h3>
- (id) <b>objectForKey:</b> (NSString*)key;<br />
<div class="desc">
Returns the value of the named field. <br /> The
field name is case insensitive.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLRecord-replaceObjectAtIndex$withObject$">replaceObjectAtIndex: withObject: </a></h3>
- (void) <b>replaceObjectAtIndex:</b> (<a rel="gsdoc" href="/usr/share/GNUstep/Documentation/Performance/GSLinkedList.html#type$NSUInteger">NSUInteger</a>)index<b> withObject:</b> (id)anObject;<br />
<div class="desc">
Replaces the value at the specified
<var>index</var>. <br /> Subclasses must implement
this method.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLRecord-setObject$forKey$">setObject: forKey: </a></h3>
- (void) <b>setObject:</b> (id)anObject<b> forKey:</b> (NSString*)aKey;<br />
<div class="desc">
Replaces the value of the named field. <br /> The
field name is case insensitive. <br /> NB. You must
be careful not to change the contents of a record which
has been cached (unless you are sure you really want
to), as you will be changing the contents of the
cache, not just a private copy.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLRecord-sizeInBytes$">sizeInBytes: </a></h3>
- (<a rel="gsdoc" href="/usr/share/GNUstep/Documentation/Performance/GSLinkedList.html#type$NSUInteger">NSUInteger</a>) <b>sizeInBytes:</b> (NSMutableSet*)exclude;<br />
<div class="desc">
Return approximate size of this record in bytes.
<br /> The <var>exclude</var> set is used to specify
objects to <var>exclude</var> from the calculation
(to prevent recursion etc).
</div>
<hr width="25%" align="left" />
</div>
<h1><a name="005000000000">
Software documentation for the SQLSetBuilder class
</a></h1>
<h2><a name="class$SQLSetBuilder">SQLSetBuilder</a> : NSObject</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>SQLClient.h</dd>
</dl>
</blockquote>
<div class="desc">
<em>Description forthcoming.</em>
</div>
<hr width="50%" align="left" />
<a href="#_SQLSetBuilder_ivars">Instance Variables</a>
<br/><br/>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLSetBuilder-addObject$">-addObject:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLSetBuilder-added">-added</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLSetBuilder-alloc">-alloc</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLSetBuilder-content">-content</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLSetBuilder-initWithCapacity$">-initWithCapacity:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLSetBuilder-mutableCopyWithZone$">-mutableCopyWithZone:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLSetBuilder-newWithValues$keys$count$">-newWithValues:keys:count:</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$SQLSetBuilder-addObject$">addObject: </a></h3>
- (void) <b>addObject:</b> (id)anObject;<br />
<div class="desc">
No need to do anything... the object will already have
been added by the
<a rel="gsdoc" href="#method$SQLSetBuilder-newWithValues$keys$count$">
-newWithValues:keys:count:
</a>
method.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLSetBuilder-added">added </a></h3>
- (<a rel="gsdoc" href="/usr/share/GNUstep/Documentation/Performance/GSLinkedList.html#type$NSUInteger">NSUInteger</a>) <b>added</b>;<br />
<div class="desc">
Returns the number of objects actually added to the
counted set.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLSetBuilder-alloc">alloc </a></h3>
- (id) <b>alloc</b>;<br />
<div class="desc">
When a container is supposed to be allocated, we just
return the receiver (which will then quietly ignore
<a rel="gsdoc" href="#method$SQLSetBuilder-addObject$">
-addObject:
</a>
messages).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLSetBuilder-content">content </a></h3>
- (NSCountedSet*) <b>content</b>;<br />
<div class="desc">
Returns the counted set for the receiver.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLSetBuilder-initWithCapacity$">initWithCapacity: </a></h3>
- (id) <b>initWithCapacity:</b> (<a rel="gsdoc" href="/usr/share/GNUstep/Documentation/Performance/GSLinkedList.html#type$NSUInteger">NSUInteger</a>)capacity;<br />
<div class="desc">
Creates a new content set... this method will be
called automatically by the SQLClient object when it
performs a query, so there is no need to call it
at any other time.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLSetBuilder-mutableCopyWithZone$">mutableCopyWithZone: </a></h3>
- (id) <b>mutableCopyWithZone:</b> (NSZone*)aZone;<br />
<div class="desc">
Makes a mutable copy of the content dictionary
(called when a caching query uses this helper to
produce the cached collection).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLSetBuilder-newWithValues$keys$count$">newWithValues: keys: count: </a></h3>
- (id) <b>newWithValues:</b> (id*)values<b> keys:</b> (NSString**)keys<b> count:</b> (unsigned int)count;<br />
<div class="desc">
This is the main workhorse of the class... it is
called once for every record read from the database,
and is responsible for adding that record to the
content set. The default implementation, instead of
creating an object to hold the supplied record
data, uses the singe field from the record to add to
the content set, and returns <code>nil</code> as the
record object. It's OK to return a <code>nil</code>
object since we ignore the
<a rel="gsdoc" href="#method$SQLSetBuilder-addObject$">
-addObject:
</a>
argument.
</div>
<hr width="25%" align="left" />
</div>
<a name="_SQLSetBuilder_ivars"/> <br/><hr width="50%" align="left" />
<h2>Instance Variables for SQLSetBuilder Class</h2>
<h3><a name="ivariable$SQLSetBuilder*added">added</a></h3>
@protected NSUInteger <b>added</b>;<br />
<div class="desc">
<em>Description forthcoming.</em>
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLSetBuilder*content">content</a></h3>
@protected NSCountedSet* <b>content</b>;<br />
<div class="desc">
<em>Description forthcoming.</em>
</div>
<hr width="25%" align="left" />
<br/><hr width="50%" align="left" /><br/>
<h1><a name="006000000000">
Software documentation for the SQLSingletonBuilder
class
</a></h1>
<h2><a name="class$SQLSingletonBuilder">SQLSingletonBuilder</a> : NSObject</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>SQLClient.h</dd>
</dl>
</blockquote>
<div class="desc">
<em>Description forthcoming.</em>
</div>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLSingletonBuilder-newWithValues$keys$count$">-newWithValues:keys:count:</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$SQLSingletonBuilder-newWithValues$keys$count$">newWithValues: keys: count: </a></h3>
- (id) <b>newWithValues:</b> (id*)values<b> keys:</b> (NSString**)keys<b> count:</b> (unsigned int)count;<br />
<div class="desc">
<em>Description forthcoming.</em>
</div>
<hr width="25%" align="left" />
</div>
<h1><a name="007000000000">
Software documentation for the SQLTransaction class
</a></h1>
<h2><a name="class$SQLTransaction">SQLTransaction</a> : NSObject</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>SQLClient.h</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>Conforms to:</b></dt>
<dd>NSCopying</dd>
</dl>
</blockquote>
<div class="desc">
The SQLTransaction transaction class provides a
convenient mechanism for grouping together a
series of SQL statements to be executed as a single
transaction. It avoids the need for handling
begin/commit, and should be as efficient as
reasonably possible. <br /> You obtain an instance
by calling
[SQLClient -transaction]
, add SQL statements to it using the
<a rel="gsdoc" href="#method$SQLTransaction-add$,...">
-add:,...
</a>
and/or
<a rel="gsdoc" href="#method$SQLTransaction-add$with$">
-add:with:
</a>
methods, and then use the
<a rel="gsdoc" href="#method$SQLTransaction-execute">
-execute
</a>
method to perform all the statements as a single
operation. <br /> Any exception is caught and
re-raised in the
<a rel="gsdoc" href="#method$SQLTransaction-execute">
-execute
</a>
method after any tidying up to leave the database in a
consistent state. <br /> NB. This class is not in
itsself thread-safe, though the underlying database
operations should be. If you have multiple
threads, you should create multiple SQLTransaction
instances, at least one per thread.
</div>
<hr width="50%" align="left" />
<a href="#_SQLTransaction_ivars">Instance Variables</a>
<br/><br/>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-add$,...">-add:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-add$with$">-add:with:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-append$">-append:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-copyWithZone$">-copyWithZone:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-count">-count</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-db">-db</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-execute">-execute</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-executeBatch">-executeBatch</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-executeBatchReturningFailures$logExceptions$">-executeBatchReturningFailures:logExceptions:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-insertTransaction$atIndex$">-insertTransaction:atIndex:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-removeTransactionAtIndex$">-removeTransactionAtIndex:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-reset">-reset</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-totalCount">-totalCount</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLTransaction-transactionAtIndex$">-transactionAtIndex:</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$SQLTransaction-add$,...">add: ,...</a></h3>
- (void) <b>add:</b> (NSString*)stmt<b>,...</b>;<br />
<div class="desc">
Adds an SQL statement to the transaction. This is
similar to
<a rel="gsdoc" href="#method$SQLClient-execute$,...">
[SQLClient -execute:,...]
</a>
but does not cause any database operation until
<a rel="gsdoc" href="#method$SQLTransaction-execute">
-execute
</a>
is called, so it will not raise a database exception.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-add$with$">add: with: </a></h3>
- (void) <b>add:</b> (NSString*)stmt<b> with:</b> (NSDictionary*)values;<br />
<div class="desc">
Adds an SQL statement to the transaction. This is
similar to
<a rel="gsdoc" href="#method$SQLClient-execute$with$">
[SQLClient -execute:with:]
</a>
but does not cause any database operation until
<a rel="gsdoc" href="#method$SQLTransaction-execute">
-execute
</a>
is called, so it will not raise a database exception.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-append$">append: </a></h3>
- (void) <b>append:</b> (<a rel="gsdoc" href="#class$SQLTransaction">SQLTransaction</a>*)other;<br />
<div class="desc">
Appends a copy of the <var>other</var> transaction
to the receiver. <br /> This provides a convenient way
of merging transactions which have been built by
different code modules, in order to have them all
executed together in a single operation (for
efficiency etc). <br /> This does not alter the
<var>other</var> transaction, so if the execution of
a group of merged transactions fails, it is then possible
to attempt to commit the individual transactions
separately. <br /> NB. All transactions
appended must be using the same database
connection (SQLClient instance).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-copyWithZone$">copyWithZone: </a></h3>
- (id) <b>copyWithZone:</b> (NSZone*)z;<br />
<div class="desc">
Make a copy of the receiver.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-count">count </a></h3>
- (<a rel="gsdoc" href="/usr/share/GNUstep/Documentation/Performance/GSLinkedList.html#type$NSUInteger">NSUInteger</a>) <b>count</b>;<br />
<div class="desc">
Returns the number of individual statements ond/r
subsidiary transactions which have been added to
the receiver. For a count of the total number of
statements, use the
<a rel="gsdoc" href="#method$SQLTransaction-totalCount">
-totalCount
</a>
method.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-db">db </a></h3>
- (<a rel="gsdoc" href="#class$SQLClient">SQLClient</a>*) <b>db</b>;<br />
<div class="desc">
Returns the database client with which this
instance operates. <br /> This client is retained
by the transaction.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-execute">execute </a></h3>
- (void) <b>execute</b>;<br />
<div class="desc">
</p>
<p>
Performs any statements added to the transaction
as a single operation. If any problem occurs, an
NSException is raised, but the database
connection is left in a consistent state and a
partially completed operation is rolled back.
</p>
<p>
</p>
<p>
NB. If the database is not already in a transaction,
this implicitly calls the
<a rel="gsdoc" href="#method$SQLClient-begin">
-begin
</a>
method to start the transaction before executing
the statements. <br /> The method always commits the
transaction, even if the transaction was
begun earlier rather than in
<a rel="gsdoc" href="#method$SQLTransaction-execute">
-execute
</a>
. <br /> This behavior allows you to call
<a rel="gsdoc" href="#method$SQLClient-begin">
[SQLClient -begin]
</a>
, then run one or more queries, build up a transaction
based upon the query results, and then
<a rel="gsdoc" href="#method$SQLTransaction-execute">
-execute
</a>
that transaction, causing the entire process to be
commited as a single transaction.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-executeBatch">executeBatch </a></h3>
- (unsigned) <b>executeBatch</b>;<br />
<div class="desc">
Convenience method which calls
<a rel="gsdoc" href="#method$SQLTransaction-executeBatchReturningFailures$logExceptions$">-executeBatchReturningFailures:logExceptions:</a>
with a <code>nil</code> failures argument and exception logging off.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-executeBatchReturningFailures$logExceptions$">executeBatchReturningFailures: logExceptions: </a></h3>
- (unsigned) <b>executeBatchReturningFailures:</b> (<a rel="gsdoc" href="#class$SQLTransaction">SQLTransaction</a>*)failures<b> logExceptions:</b> (BOOL)log;<br />
<div class="desc">
</p>
<p>
This is similar to the
<a rel="gsdoc" href="#method$SQLTransaction-execute">
-execute
</a>
method, but may allow partial execution of the
transaction if appropriate:
</p>
<p>
</p>
<p>
If the transaction was created using the
[SQLClient -batch:]
method and the transaction as a whole fails,
individual statements are retried. <br /> The
stopOnFailure flag for the batch creation
indicates whether the retries are stopped at
the first statement to fail, or continue (skipping
any failed statements).
</p>
<p>
</p>
<p>
If the transaction has had transactions appended to
it, those subsidiary transactions may succeed or fail
atomically depending on their individual
attributes.
</p>
<p>
</p>
<p>
If the transaction was not created using
[SQLClient -batch:]
, then calling this method is equivalent to calling the
<a rel="gsdoc" href="#method$SQLTransaction-execute">
-execute
</a>
method.
</p>
<p>
</p>
<p>
If any statements/transactions in the batch fail, they
are added to the transaction supplied in the
<var>failures</var> parameter (if it's not
<code>nil</code>) so that you can retry them
later. <br /> NB. statements/transactions which
are not executed at all (because the batch is set to
stop on the first failure) are <em>also</em> added
to the <var>failures</var> transaction.
</p>
<p>
</p>
<p>
If the <var>log</var> argument is <code>YES</code>,
then any exceptions encountered when executing the
batch are logged using the
[SQLClient -debug:,...]
method, even if debug logging is not enabled with
[SQLClient -setDebugging:]
.
</p>
<p>
The method returns the number of statements which
actually succeeded.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-insertTransaction$atIndex$">insertTransaction: atIndex: </a></h3>
- (void) <b>insertTransaction:</b> (<a rel="gsdoc" href="#class$SQLTransaction">SQLTransaction</a>*)trn<b> atIndex:</b> (unsigned)index;<br />
<div class="desc">
Insert <var>trn</var> at the index'th position in
the receiver. <br /> The transaction <var>trn</var>
must be non-empty and must use the same database
client as the receiver.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-removeTransactionAtIndex$">removeTransactionAtIndex: </a></h3>
- (void) <b>removeTransactionAtIndex:</b> (unsigned)index;<br />
<div class="desc">
Remove the index'th transaction or statement from
the receiver.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-reset">reset </a></h3>
- (void) <b>reset</b>;<br />
<div class="desc">
Resets the transaction, removing all previously
added statements. This allows the transaction object
to be re-used for multiple transactions.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-totalCount">totalCount </a></h3>
- (unsigned) <b>totalCount</b>;<br />
<div class="desc">
Returns the total count of statements in this
transaction including those in any subsidiary
transactions. For a count of the statements
and/or transactions directly added to the receiver,
use the <a rel="gsdoc" href="#method$SQLTransaction-count">-count</a>
method.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLTransaction-transactionAtIndex$">transactionAtIndex: </a></h3>
- (<a rel="gsdoc" href="#class$SQLTransaction">SQLTransaction</a>*) <b>transactionAtIndex:</b> (unsigned)index;<br />
<div class="desc">
Return an autoreleased copy of the index'th
transaction or statement added to the receiver.
<br /> Since the returned transaction contains a
copy of the statement/transaction in the receiver, you
can modify it without effecting the original.
</div>
<hr width="25%" align="left" />
</div>
<a name="_SQLTransaction_ivars"/> <br/><hr width="50%" align="left" />
<h2>Instance Variables for SQLTransaction Class</h2>
<h3><a name="ivariable$SQLTransaction*_batch">_batch</a></h3>
@protected BOOL <b>_batch</b>;<br />
<div class="desc">
<em>Warning</em> the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically <em>private</em>, it is
intended for internal use within the package, and
you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLTransaction*_count">_count</a></h3>
@protected unsigned int <b>_count</b>;<br />
<div class="desc">
<em>Warning</em> the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically <em>private</em>, it is
intended for internal use within the package, and
you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLTransaction*_db">_db</a></h3>
@protected SQLClient* <b>_db</b>;<br />
<div class="desc">
<em>Warning</em> the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically <em>private</em>, it is
intended for internal use within the package, and
you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLTransaction*_info">_info</a></h3>
@protected NSMutableArray* <b>_info</b>;<br />
<div class="desc">
<em>Warning</em> the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically <em>private</em>, it is
intended for internal use within the package, and
you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<h3><a name="ivariable$SQLTransaction*_stop">_stop</a></h3>
@protected BOOL <b>_stop</b>;<br />
<div class="desc">
<em>Warning</em> the underscore at the start of the
name of this instance variable indicates that, even
though it is not technically <em>private</em>, it is
intended for internal use within the package, and
you should not use the variable in other code.
</div>
<hr width="25%" align="left" />
<br/><hr width="50%" align="left" /><br/>
<h1><a name="008000000000">
Software documentation for the SQLClient(Caching)
category
</a></h1>
<h2><a rel="gsdoc" href="#class$SQLClient">SQLClient</a>(<a name="category$SQLClient(Caching)">Caching</a>)</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>SQLClient.h</dd>
</dl>
</blockquote>
<div class="desc">
This category provides methods for caching the results
of queries in order to reduce the number of client-server
trips and the database load produced by an application
which needs update its information from the database
frequently.
</div>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-cache">-cache</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-cache$query$,...">-cache:query:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-cache$query$with$">-cache:query:with:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-cache$simpleQuery$">-cache:simpleQuery:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-cache$simpleQuery$recordType$listType$">-cache:simpleQuery:recordType:listType:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-setCache$">-setCache:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Caching)-setCacheThread$">-setCacheThread:</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$SQLClient(Caching)-cache">cache </a></h3>
- (<a rel="gsdoc" href="/usr/share/GNUstep/Documentation/Performance/GSCache.html#class$GSCache">GSCache</a>*) <b>cache</b>;<br />
<div class="desc">
Returns the cache used by the receiver for storing
the results of requests made through it. Creates a new
cache if necessary.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Caching)-cache$query$,...">cache: query: ,...</a></h3>
- (NSMutableArray*) <b>cache:</b> (int)seconds<b> query:</b> (NSString*)stmt<b>,...</b>;<br />
<div class="desc">
Calls
<a rel="gsdoc" href="#method$SQLClient(Caching)-cache$simpleQuery$recordType$listType$">-cache:simpleQuery:recordType:listType:</a>
with the default record class, array class, and with a query string formed from <var>stmt</var> and the following values (if any).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Caching)-cache$query$with$">cache: query: with: </a></h3>
- (NSMutableArray*) <b>cache:</b> (int)seconds<b> query:</b> (NSString*)stmt<b> with:</b> (NSDictionary*)values;<br />
<div class="desc">
Calls
<a rel="gsdoc" href="#method$SQLClient(Caching)-cache$simpleQuery$recordType$listType$">-cache:simpleQuery:recordType:listType:</a>
with the default record class array class and with a query string formed from <var>stmt</var> and <var>values</var>.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Caching)-cache$simpleQuery$">cache: simpleQuery: </a></h3>
- (NSMutableArray*) <b>cache:</b> (int)seconds<b> simpleQuery:</b> (NSString*)stmt;<br />
<div class="desc">
Calls
<a rel="gsdoc" href="#method$SQLClient(Caching)-cache$simpleQuery$recordType$listType$">-cache:simpleQuery:recordType:listType:</a>
with the default record class and array class.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Caching)-cache$simpleQuery$recordType$listType$">cache: simpleQuery: recordType: listType: </a></h3>
- (NSMutableArray*) <b>cache:</b> (int)seconds<b> simpleQuery:</b> (NSString*)stmt<b> recordType:</b> (id)rtype<b> listType:</b> (id)ltype;<br />
<div class="desc">
If the result of the query is already cached and has not
expired, return it. Otherwise, perform the query
and cache the result giving it the specified lifetime
in <var>seconds</var>. <br /> If <var>seconds</var> is
negative, the query is performed irrespective of
whether it is already cached, and its absolute
value is used to set the lifetime of the results.
<br /> If <var>seconds</var> is zero, the cache for
this query is emptied. <br /> Handles locking. <br />
Maintains
<a rel="gsdoc" href="#method$SQLClient-lastOperation">
-lastOperation
</a>
date. <br /> The value of <var>rtype</var> must
respond to the
<a rel="gsdoc" href="#method$SQLRecord+newWithValues$keys$count$">[SQLRecord +newWithValues:keys:count:]</a>
method. <br /> If <var>rtype</var> is <code>nil</code> then the
<a rel="gsdoc" href="#class$SQLRecord">SQLRecord</a>
class is used. <br /> The value of <var>ltype</var>
must respond to the
[NSObject +alloc]
method to produce a container which must repond to
the
[NSMutableArray -initWithCapacity:]
method to initialise itsself and the [NSMutableArray -addObject:]
method to add records to the list. <br /> If <var>ltype</var> is <code>nil</code> then the
NSMutableArray
class is used. <br /> The list produced by this
argument is used as the return value of this
method. <br /> If a cache thread has been set
using the
<a rel="gsdoc" href="#method$SQLClient(Caching)-setCacheThread$">
-setCacheThread:
</a>
method, and the
<a rel="gsdoc" href="#method$SQLClient(Caching)-cache$simpleQuery$recordType$listType$">-cache:simpleQuery:recordType:listType:</a>
method is called from a thread other than the cache thread, then any query to retrieve uncached data will be performed in the cache thread, and for cached (but expired) data, the old (expired) results may be returned... in which case an asynchronous query to update the cache will be executed as soon as possible in the cache thread.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Caching)-setCache$">setCache: </a></h3>
- (void) <b>setCache:</b> (<a rel="gsdoc" href="/usr/share/GNUstep/Documentation/Performance/GSCache.html#class$GSCache">GSCache</a>*)aCache;<br />
<div class="desc">
Sets the cache to be used by the receiver for storing
the results of requests made through it. <br /> If
<var>aCache</var> is <code>nil</code>, the current
cache is released, and a new cache will be
automatically created as soon as there is a
need to cache anything.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Caching)-setCacheThread$">setCacheThread: </a></h3>
- (void) <b>setCacheThread:</b> (NSThread*)aThread;<br />
<div class="desc">
Sets the thread to be used to retrieve data to
populate the cache. <br /> All cached queries will
be performed in this thread (if non-nil). <br /> The
setting of a thread for the cache also implies that
expired items in the cache may not be removed when
they are queried from another thread, rather they can
be kept (if they are not <em>too</em> old) and an
asynchronous query to update them will be run
on the cache thread. <br /> The rule is that, if the
item's age is more than twice its nominal lifetime,
it will be retrieved immediately, otherwise it will be
retrieved asynchrnonously. <br /> Currently this
may only be the main thread or <code>nil</code>. Any
attempt to set another thread will use the main
thread instead.
</div>
<hr width="25%" align="left" />
</div>
<h1><a name="009000000000">
Software documentation for the SQLClient(Convenience)
category
</a></h1>
<h2><a rel="gsdoc" href="#class$SQLClient">SQLClient</a>(<a name="category$SQLClient(Convenience)">Convenience</a>)</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>SQLClient.h</dd>
</dl>
</blockquote>
<div class="desc">
This category contains convenience methods including
those for frequently performed database operations...
message logging etc.
</div>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Convenience)-batch$">-batch:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Convenience)-columns$">-columns:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Convenience)-queryRecord$,...">-queryRecord:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Convenience)-queryString$,...">-queryString:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Convenience)-singletons$">-singletons:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Convenience)-transaction">-transaction</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$SQLClient(Convenience)-batch$">batch: </a></h3>
- (<a rel="gsdoc" href="#class$SQLTransaction">SQLTransaction</a>*) <b>batch:</b> (BOOL)stopOnFailure;<br />
<div class="desc">
Returns a transaction object configured to handle
batching and execute part of a batch of statements
if execution of the whole using the
<a rel="gsdoc" href="#method$SQLTransaction-executeBatch">[SQLTransaction -executeBatch]</a>
method fails. <br /> If <var>stopOnFailure</var> is <code>YES</code> than execution of the transaction will stop with the first statement to fail, otherwise it will execute all the statements it can, skipping any failed statements.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Convenience)-columns$">columns: </a></h3>
- (NSMutableArray*) <b>columns:</b> (NSMutableArray*)records;<br />
<div class="desc">
Convenience method to deal with the results of
a query converting the normal array of <var>records</var>
into an array of record columns. Each column in the
array is an array containing all the values from that
column.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Convenience)-queryRecord$,...">queryRecord: ,...</a></h3>
- (<a rel="gsdoc" href="#class$SQLRecord">SQLRecord</a>*) <b>queryRecord:</b> (NSString*)stmt<b>,...</b>;<br />
<div class="desc">
Executes a query (like the
<a rel="gsdoc" href="#method$SQLClient-query$,...">
-query:,...
</a>
method) and checks the result (raising an exception
if the query did not contain a single record) and
returns the resulting record.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Convenience)-queryString$,...">queryString: ,...</a></h3>
- (NSString*) <b>queryString:</b> (NSString*)stmt<b>,...</b>;<br />
<div class="desc">
Executes a query (like the
<a rel="gsdoc" href="#method$SQLClient-query$,...">
-query:,...
</a>
method) and checks the result. <br /> Raises an
exception if the query did not contain a single
record, or if the record did not contain a single
field. <br /> Returns the resulting field as a
<em>string</em>.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Convenience)-singletons$">singletons: </a></h3>
- (void) <b>singletons:</b> (NSMutableArray*)records;<br />
<div class="desc">
Convenience method to deal with the results of
a query where each record contains a single field... it
converts the array of <var>records</var> returned
by the query to an array containing the fields. <br />
NB. This does not check that the contents of the
<var>records</var> array are actually instances of
<a rel="gsdoc" href="#class$SQLRecord">SQLRecord</a>
, so you must ensure you don't call it more than once
on the same array (something that may happen if you
retrieve the array using a cache based query).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Convenience)-transaction">transaction </a></h3>
- (<a rel="gsdoc" href="#class$SQLTransaction">SQLTransaction</a>*) <b>transaction</b>;<br />
<div class="desc">
Creates and returns an autoreleased SQLTransaction
instance which will use the receiver as the
database connection to perform transactions.
</div>
<hr width="25%" align="left" />
</div>
<h1><a name="010000000000">
Software documentation for the SQLClient(Logging)
category
</a></h1>
<h2><a rel="gsdoc" href="#class$SQLClient">SQLClient</a>(<a name="category$SQLClient(Logging)">Logging</a>)</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>SQLClient.h</dd>
</dl>
</blockquote>
<div class="desc">
This category porovides basic methods for logging debug
information.
</div>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)+debugging">+debugging</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)+durationLogging">+durationLogging</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)+setDebugging$">+setDebugging:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)+setDurationLogging$">+setDurationLogging:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)-debug$,...">-debug:,...</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)-debugging">-debugging</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)-durationLogging">-durationLogging</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)-setDebugging$">-setDebugging:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Logging)-setDurationLogging$">-setDurationLogging:</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$SQLClient(Logging)+debugging">debugging </a></h3>
+ (unsigned int) <b>debugging</b>;<br />
<div class="desc">
Return the class-wide debugging level, which is
inherited by all newly created instances.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Logging)+durationLogging">durationLogging </a></h3>
+ (NSTimeInterval) <b>durationLogging</b>;<br />
<div class="desc">
Return the class-wide duration logging threshold,
which is inherited by all newly created instances.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Logging)+setDebugging$">setDebugging: </a></h3>
+ (void) <b>setDebugging:</b> (unsigned int)level;<br />
<div class="desc">
Set the debugging <var>level</var> to be inherited by
all new instances. <br /> See
<a rel="gsdoc" href="#method$SQLClient(Logging)-setDebugging$">[SQLClient(Logging) -setDebugging:]</a>
for controlling an individual instance of the class.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Logging)+setDurationLogging$">setDurationLogging: </a></h3>
+ (void) <b>setDurationLogging:</b> (NSTimeInterval)threshold;<br />
<div class="desc">
Set the duration logging <var>threshold</var> to be
inherited by new instances. <br /> See
<a rel="gsdoc" href="#method$SQLClient(Logging)-setDurationLogging$">[SQLClient(Logging) -setDurationLogging:]</a>
for controlling an individual instance of the class.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Logging)-debug$,...">debug: ,...</a></h3>
- (void) <b>debug:</b> (NSString*)fmt<b>,...</b>;<br />
<div class="desc">
The default implementation calls NSLogv to log a debug
message. <br /> Override this in a category to
provide more sophisticated logging. <br /> Do NOT
override with code which can be slow or which
calls (directly or indirectly) any SQLCLient methods,
since this method will be used inside locked regions
of the SQLClient code and you could cause deadlocks or
<strong>long</strong> delays to other threads
using the class.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Logging)-debugging">debugging </a></h3>
- (unsigned int) <b>debugging</b>;<br />
<div class="desc">
Return the current debugging level. <br /> A level
of zero (default) means that no debug output is
produced, except for that concerned with logging
the database transactions taking over a certain amount
of time (see the
<a rel="gsdoc" href="#method$SQLClient(Logging)-setDurationLogging$">
-setDurationLogging:
</a>
method).
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Logging)-durationLogging">durationLogging </a></h3>
- (NSTimeInterval) <b>durationLogging</b>;<br />
<div class="desc">
Returns the threshold above which queries and
statements taking a <strong>long</strong> time
to execute are logged. A negative value (default)
indicates that this logging is disabled. A value
of zero means that all statements are logged.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Logging)-setDebugging$">setDebugging: </a></h3>
- (void) <b>setDebugging:</b> (unsigned int)level;<br />
<div class="desc">
Set the debugging <var>level</var> of this instance...
overrides the default <var>level</var> inherited
from the class.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Logging)-setDurationLogging$">setDurationLogging: </a></h3>
- (void) <b>setDurationLogging:</b> (NSTimeInterval)threshold;<br />
<div class="desc">
Set a <var>threshold</var> above which queries and
statements taking a <strong>long</strong> time
to execute are logged. A negative value (default)
disables this logging. A value of zero logs all
statements.
</div>
<hr width="25%" align="left" />
</div>
<h1><a name="011000000000">
Software documentation for the
SQLClient(Notifications) category
</a></h1>
<h2><a rel="gsdoc" href="#class$SQLClient">SQLClient</a>(<a name="category$SQLClient(Notifications)">Notifications</a>)</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>SQLClient.h</dd>
</dl>
</blockquote>
<div class="desc">
This category contains methods for asynchronous
notification of events via the database (for
those database backends which support it: currently
only PostgreSQL).
</div>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Notifications)-addObserver$selector$name$">-addObserver:selector:name:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Notifications)-postNotificationName$payload$">-postNotificationName:payload:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Notifications)-removeObserver$name$">-removeObserver:name:</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$SQLClient(Notifications)-addObserver$selector$name$">addObserver: selector: name: </a></h3>
- (void) <b>addObserver:</b> (id)anObserver<b> selector:</b> (SEL)aSelector<b> name:</b> (NSString*)name;<br />
<div class="desc">
Adds <var>anObserver</var> to receive notifications
when the backend database server sends an asynchronous
event identified by the specified <var>name</var>
(which must be a valid database identifier). <br />
When a notification (NSNotification instance) is
received by the method specified by
<var>aSelector</var>, its <em>object</em> will be the
SQLClient instance to which <var>anObserver</var>
was added and its userInfo dictionary will contain the
key 'Local' and possibly the key 'Payload'. <br /> If
the 'Local' value is the boolean <code>YES</code>, the
notification originated as an action by this
SQLClient instance. <br /> If the 'Payload' value
is not <code>nil</code>, then it is a string providing
extra information about the notification. <br /> NB.
At the point when the observer is notified about an
event the database client object will be locked and
may not be used to query or modify the database
(typically a database query will already be in
progress). The method handling the notification
must therefore handle any database operations in a
later timeout.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Notifications)-postNotificationName$payload$">postNotificationName: payload: </a></h3>
- (void) <b>postNotificationName:</b> (NSString*)name<b> payload:</b> (NSString*)more;<br />
<div class="desc">
Posts a notification via the database. The
<var>name</var> is an SQL identifier (for which
observers may have registered) and the extra
payload information may be <code>nil</code> if not
required.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Notifications)-removeObserver$name$">removeObserver: name: </a></h3>
- (void) <b>removeObserver:</b> (id)anObserver<b> name:</b> (NSString*)name;<br />
<div class="desc">
Removes <var>anObserver</var> as an observer for
asynchronous notifications from the database
server. If <var>name</var> is omitted, the observer
will be removed for all names.
</div>
<hr width="25%" align="left" />
</div>
<h1><a name="012000000000">
Software documentation for the SQLClient(Subclass)
category
</a></h1>
<h2><a rel="gsdoc" href="#class$SQLClient">SQLClient</a>(<a name="category$SQLClient(Subclass)">Subclass</a>)</h2>
<blockquote class="declared">
<dl>
<dt><b>Declared in:</b></dt>
<dd>SQLClient.h</dd>
</dl>
</blockquote>
<div class="desc">
This category contains the methods which a subclass
<em>must</em> override to provide a working instance,
and helper methods for the backend implementations.
<br /> Application programmers should <em>not</em>
call the backend methods directly. <br />
</p>
<p>
When subclassing to produce a backend driver bundle,
please be aware that the subclass must <em>NOT</em>
introduce additional instance variables. Instead
the <em>extra</em> instance variable is provided for
use as a pointer to subclass specific data.
</p>
<p>
</div>
<b>Method summary</b>
<ul>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendConnect">-backendConnect</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendDisconnect">-backendDisconnect</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendExecute$">-backendExecute:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendListen$">-backendListen:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendNotify$payload$">-backendNotify:payload:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendQuery$">-backendQuery:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendQuery$recordType$listType$">-backendQuery:recordType:listType:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-backendUnlisten$">-backendUnlisten:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-copyEscapedBLOB$into$">-copyEscapedBLOB:into:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-insertBLOBs$intoStatement$length$withMarker$length$giving$">-insertBLOBs:intoStatement:length:withMarker:length:giving:</a></li>
<li><a rel="gsdoc" href="SQLClient.html#method$SQLClient(Subclass)-lengthOfEscapedBLOB$">-lengthOfEscapedBLOB:</a></li>
</ul>
<hr width="50%" align="left" />
<div class="method">
<h3><a name="method$SQLClient(Subclass)-backendConnect">backendConnect </a></h3>
- (BOOL) <b>backendConnect</b>;<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
Attempts to establish a connection to the database
server. <br /> Returns a flag to indicate whether
the connection has been established. <br /> If a
connection was already established, returns
<code>YES</code> and does nothing. <br /> You should
not need to use this method normally, as it is called
for you automatically when necessary. <br />
</p>
<p>
Subclasses <strong>must</strong> implement
this method to establish a connection to the
database server process (and initialise the
<em>extra</em> instance variable if necessary),
setting the <em>connected</em> instance variable
to indicate the state of the object.
</p>
<p>
</p>
<p>
This method must call
<a rel="gsdoc" href="#method$SQLClient+purgeConnections$">
+purgeConnections:
</a>
to ensure that there is a free slot for the new
connection.
</p>
<p>
</p>
<p>
Application code must <em>not</em> call this
method directly, it is for internal use only. The
<a rel="gsdoc" href="#method$SQLClient-connect">
-connect
</a>
method calls this method if the <em>connected</em>
instance variable is <code>NO</code>.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Subclass)-backendDisconnect">backendDisconnect </a></h3>
- (void) <b>backendDisconnect</b>;<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
Disconnect from the database unless already
disconnected. <br />
</p>
<p>
This method is called automatically when the
receiver is deallocated or reconfigured, and may
also be called automatically when there are too many
database connections active.
</p>
<p>
</p>
<p>
If the receiver is an instance of a subclass which
uses the <em>extra</em> instance variable, it
<strong>must</strong> clear that variable in the
<a rel="gsdoc" href="#method$SQLClient(Subclass)-backendDisconnect">
-backendDisconnect
</a>
method, because a reconfiguration may cause the
class of the receiver to change.
</p>
<p>
</p>
<p>
This method must set the <em>connected</em> instance
variable to <code>NO</code>.
</p>
<p>
</p>
<p>
Application code must <em>not</em> call this
method directly, it is for internal use only. The
<a rel="gsdoc" href="#method$SQLClient-disconnect">
-disconnect
</a>
method calls this method if the <em>connected</em>
instance variable is <code>YES</code>.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Subclass)-backendExecute$">backendExecute: </a></h3>
- (NSInteger) <b>backendExecute:</b> (NSArray*)info;<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
Perform arbitrary operation
<em>which does not return any value.</em> <br /> This
method has a single argument, an array containing
the string representing the statement to be executed as
its first object, and an optional sequence of data
objects following it. <br />
<pre>
[db backendExecute: [NSArray arrayWithObject:
@"UPDATE MyTable SET Name = 'The name' WHERE ID = 123"]];
</pre>
</p>
<p>
The backend implementation is required to perform the
SQL statement using the supplied NSData objects at
the points in the statement marked by the
<code>'?'''?'</code> sequence. The marker
saequences are inserted into the statement at
an earlier stage by the
<a rel="gsdoc" href="#method$SQLClient-execute$,...">
-execute:,...
</a>
and
<a rel="gsdoc" href="#method$SQLClient-execute$with$">
-execute:with:
</a>
methods.
</p>
<p>
</p>
<p>
Callers should lock the instance using the
<em>lock</em> instance variable for the duration of
the operation, and unlock it afterwards.
</p>
<p>
</p>
<p>
NB. callers (other than the
<a rel="gsdoc" href="#method$SQLClient-begin">
-begin
</a>
, <a rel="gsdoc" href="#method$SQLClient-commit">-commit</a>
, and
<a rel="gsdoc" href="#method$SQLClient-rollback">
-rollback
</a>
methods) should not pass any statement to this
method which would cause a transaction to begin or
end.
</p>
<p>
</p>
<p>
Application code must <em>not</em> call this
method directly, it is for internal use only.
</p>
<p>
</p>
<p>
Where the database backend support it, this method
returns the count of the number of rows to which
the operation applied. Otherwise this returns -1.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Subclass)-backendListen$">backendListen: </a></h3>
- (void) <b>backendListen:</b> (NSString*)name;<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
Called to enable asynchronous notification of
database events using the specified
<var>name</var> (which must be a valid identifier
consisting of ascii letters, digits, and
underscore characters, starting with a letter).
Names are not case sensitive (so AAA is the same as
aaa). <br /> Repeated calls to list on the same
<var>name</var> should be treated as a single call.
<br /> The backend is responsible for implicitly
unlistening when a connection is closed. <br />
There is a default implementation which does nothing
... for backends which don't support asynchronous
notifications. <br /> If a backend
<em>does</em> support asynchronous notifications, it
should do so by posting NSNotification instances to
[NSNotificationCenter defaultCenter]
using the SQLClient instance as the notification
object and supplying any payload as a string using
the 'Payload' key in the NSNotification userInfo
dictionary. The userInfo dictionary should also
contain a boolean (NSNumber) value, using the
'Local' key, to indicate whether the notification
was sent by the current SQLClient instance or by some
other client/
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Subclass)-backendNotify$payload$">backendNotify: payload: </a></h3>
- (void) <b>backendNotify:</b> (NSString*)name<b> payload:</b> (NSString*)more;<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
The backend should implement this to send asynchronous
notifications to anything listening for them.
The <var>name</var> of the notification is an SQL
identifier used for listening for the
asynchronous data. <br /> The payload string
may be <code>nil</code> if no additional information is
needed in the notification.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Subclass)-backendQuery$">backendQuery: </a></h3>
- (NSMutableArray*) <b>backendQuery:</b> (NSString*)stmt;<br />
<div class="desc">
Calls
<a rel="gsdoc" href="#method$SQLClient(Subclass)-backendQuery$recordType$listType$">-backendQuery:recordType:listType:</a>
with the default record class and array class.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Subclass)-backendQuery$recordType$listType$">backendQuery: recordType: listType: </a></h3>
- (NSMutableArray*) <b>backendQuery:</b> (NSString*)stmt<b> recordType:</b> (id)rtype<b> listType:</b> (id)ltype;<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
</p>
<p>
Perform arbitrary query
<em>which returns values.</em>
</p>
<p>
<pre>
result = [db backendQuery: @"SELECT Name FROM Table"
recordType: [SQLRecord class]]
listType: [NSMutableArray class]];
</pre>
</p>
<p>
Upon error, an exception is raised.
</p>
<p>
</p>
<p>
The query returns an array of records (each of which
is represented by an SQLRecord object).
</p>
<p>
</p>
<p>
Each SQLRecord object contains one or more fields,
in the order in which they occurred in the query.
Fields may also be retrieved by name.
</p>
<p>
</p>
<p>
NULL field items are returned as NSNull objects.
</p>
<p>
</p>
<p>
Callers should lock the instance using the
<em>lock</em> instance variable for the duration of
the operation, and unlock it afterwards.
</p>
<p>
</p>
<p>
Application code must <em>not</em> call this
method directly, it is for internal use only.
</p>
<p>
</p>
<p>
The <var>rtype</var> argument specifies an object to
be used to create the records produced by the query.
<br /> This is provided as a performance
optimisation when you want to store data
directly into a special class of your own.
<br /> The object must respond to the [SQLRecord
+newWithValues:keys:count:]
method to produce a new record initialised with
the supplied data.
</p>
<p>
</p>
<p>
The <var>ltype</var> argument specifies an object to
be used to create objects to store the records
produced by the query. <br /> The should be a
subclass of NSMutableArray. It must at least
implement the
[NSObject +alloc]
method to create an instnce to store records. The
instance must implement
[NSMutableArray -initWithCapacity:]
to initialise itsself and [NSMutableArray -addObject:]
to allow the backend to add records to it. <br /> For caching to work, it must be possible to make a mutable copy of the instance using the mutableCopy method.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Subclass)-backendUnlisten$">backendUnlisten: </a></h3>
- (void) <b>backendUnlisten:</b> (NSString*)name;<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
Called to disable asynchronous notification of
database events using the specified
<var>name</var>. This has no effect if the
<var>name</var> has not been used in an earlier call
to
<a rel="gsdoc" href="#method$SQLClient(Subclass)-backendListen$">
-backendListen:
</a>
, or if the <var>name</var> has already been unlistened
since the last call to listen. on it. <br /> There is
a default implementation which does nothing... for
backends which don't support asynchronous
notifications.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Subclass)-copyEscapedBLOB$into$">copyEscapedBLOB: into: </a></h3>
- (unsigned) <b>copyEscapedBLOB:</b> (NSData*)blob<b> into:</b> (void*)buf;<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
This method is <em>only</em> for the use of the
<a rel="gsdoc" href="#method$SQLClient(Subclass)-insertBLOBs$intoStatement$length$withMarker$length$giving$">-insertBLOBs:intoStatement:length:withMarker:length:giving:</a>
method. <br /> Subclasses which need to insert binary data into a statement must implement this method to copy the escaped data into place and return the number of bytes actually copied.
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Subclass)-insertBLOBs$intoStatement$length$withMarker$length$giving$">insertBLOBs: intoStatement: length: withMarker: length: giving: </a></h3>
- (const void*) <b>insertBLOBs:</b> (NSArray*)blobs<b> intoStatement:</b> (const void*)statement<b> length:</b> (unsigned)sLength<b> withMarker:</b> (const void*)marker<b> length:</b> (unsigned)mLength<b> giving:</b> (unsigned*)result;<br />
<div class="desc">
</p>
<p>
This method is a convenience method provided for
subclasses which need to insert escaped binary
data into an SQL <var>statement</var> before sending
the <var>statement</var> to a backend server process.
This method makes use of the
<a rel="gsdoc" href="#method$SQLClient(Subclass)-copyEscapedBLOB$into$">
-copyEscapedBLOB:into:
</a>
and
<a rel="gsdoc" href="#method$SQLClient(Subclass)-lengthOfEscapedBLOB$">
-lengthOfEscapedBLOB:
</a>
methods, which <em>must</em> be implemented by
the subclass.
</p>
<p>
</p>
<p>
The <var>blobs</var> array is an array containing the
original SQL <var>statement</var> string (unused
by this method) followed by the data items to be
inserted.
</p>
<p>
</p>
<p>
The <var>statement</var> and <var>sLength</var>
arguments specify the datastream to be copied
and into which the BLOBs are to be inserted.
</p>
<p>
</p>
<p>
The <var>marker</var> and <var>mLength</var>
arguments specify the sequence of
<var>marker</var> bytes in the <var>statement</var>
which indicate a position for insertion of an
escaped BLOB.
</p>
<p>
</p>
<p>
The method returns either the original
<var>statement</var> or a copy containing the
escaped BLOBs. The length of the returned data is
stored in <var>result</var>.
</p>
<p>
</div>
<hr width="25%" align="left" />
</div>
<div class="method">
<h3><a name="method$SQLClient(Subclass)-lengthOfEscapedBLOB$">lengthOfEscapedBLOB: </a></h3>
- (unsigned) <b>lengthOfEscapedBLOB:</b> (NSData*)blob;<br />
Subclasses <strong>must</strong> override this method.<br />
<div class="desc">
This method is <em>only</em> for the use of the
<a rel="gsdoc" href="#method$SQLClient(Subclass)-insertBLOBs$intoStatement$length$withMarker$length$giving$">-insertBLOBs:intoStatement:length:withMarker:length:giving:</a>
method. <br /> Subclasses which need to insert binary data into a statement must implement this method to return the length of the escaped bytestream which will be inserted.
</div>
<hr width="25%" align="left" />
</div>
<h1><a name="013000000000">SQLClient constants</a></h1>
<p>
</p>
<h3><a name="constant$SQLClientDidConnectNotification">SQLClientDidConnectNotification</a></h3>
NSString* const SQLClientDidConnectNotification;<br />
<div class="desc">
Notification sent when an instance becomes
connected to the database server. The notification
object is the instance connected.
</div>
<hr width="25%" align="left" />
<h3><a name="constant$SQLClientDidDisconnectNotification">SQLClientDidDisconnectNotification</a></h3>
NSString* const SQLClientDidDisconnectNotification;<br />
<div class="desc">
Notification sent when an instance becomes
disconnected from the database server. The
notification object is the instance
disconnected.
</div>
<hr width="25%" align="left" />
<h1><a name="014000000000">SQLClient variables</a></h1>
<p>
</p>
<h3><a name="variable$SQLConnectionException">SQLConnectionException</a></h3>
NSString* SQLConnectionException;<br />
<div class="desc">
Exception for when a connection to the server is
lost.
</div>
<hr width="25%" align="left" />
<h3><a name="variable$SQLEmptyException">SQLEmptyException</a></h3>
NSString* SQLEmptyException;<br />
<div class="desc">
Exception for when a query is supposed to return
data and doesn't.
</div>
<hr width="25%" align="left" />
<h3><a name="variable$SQLException">SQLException</a></h3>
NSString* SQLException;<br />
<div class="desc">
Exception raised when an error with the remote
database server occurs.
</div>
<hr width="25%" align="left" />
<h3><a name="variable$SQLUniqueException">SQLUniqueException</a></h3>
NSString* SQLUniqueException;<br />
<div class="desc">
Exception for when an insert/update would break the
uniqueness of a field or index.
</div>
<hr width="25%" align="left" />
<h1><a name="015000000000">SQLClient functions</a></h1>
<p>
</p>
<h3><a name="function$SQLClientTimeLast">SQLClientTimeLast</a></h3>
NSTimeInterval SQLClientTimeLast();<br />
<div class="desc">
Returns the timestamp of the most recent call to
<a rel="gsdoc" href="#function$SQLClientTimeNow">
SQLClientTimeNow()
</a>
.
</div>
<hr width="25%" align="left" />
<h3><a name="function$SQLClientTimeNow">SQLClientTimeNow</a></h3>
NSTimeInterval SQLClientTimeNow();<br />
<div class="desc">
Convenience function to provide timing
information quickly. <br /> This returns the
current date/time, and stores the value for use by
the
<a rel="gsdoc" href="#function$SQLClientTimeLast">
SQLClientTimeLast()
</a>
function.
</div>
<hr width="25%" align="left" />
<h3><a name="function$SQLClientTimeStart">SQLClientTimeStart</a></h3>
NSTimeInterval SQLClientTimeStart();<br />
<div class="desc">
This returns the timestamp from which any of the
SQLClient classes was first used or
<a rel="gsdoc" href="#function$SQLClientTimeNow">
SQLClientTimeNow()
</a>
was first called (whichever came first).
</div>
<hr width="25%" align="left" />
<h3><a name="function$SQLClientTimeTick">SQLClientTimeTick</a></h3>
unsigned int SQLClientTimeTick();<br />
<div class="desc">
A convenience method to return the current clock 'tick'...
which is the current second based on the time we
started. This does <em>not</em> check the current
time, but relies on
<a rel="gsdoc" href="#function$SQLClientTimeLast">
SQLClientTimeLast()
</a>
returning an up to date value (so if you need an
accurate tick, you should ensure that
<a rel="gsdoc" href="#function$SQLClientTimeNow">
SQLClientTimeNow()
</a>
is called at least once a second). <br /> The returned
value is always greater than zero, and is basically
calculated as (SQLClientTimeLast() -
<a rel="gsdoc" href="#function$SQLClientTimeStart">
SQLClientTimeStart()
</a>
+ 1). <br /> In the event that the system clock is reset
into the past, the value of
<a rel="gsdoc" href="#function$SQLClientTimeStart">
SQLClientTimeStart()
</a>
is automatically adjusted to ensure that the result of a
call to
<a rel="gsdoc" href="#function$SQLClientTimeTick">
SQLClientTimeTick()
</a>
is never less than the result of any earlier call to the
function.
</div>
<hr width="25%" align="left" />
<br />
</font>
</body>
</html>
|