sql.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. ace.define("ace/snippets/sql",[], function(require, exports, module) {
  2. "use strict";
  3. exports.snippetText = "snippet tbl\n\
  4. create table ${1:table} (\n\
  5. ${2:columns}\n\
  6. );\n\
  7. snippet col\n\
  8. ${1:name} ${2:type} ${3:default ''} ${4:not null}\n\
  9. snippet ccol\n\
  10. ${1:name} varchar2(${2:size}) ${3:default ''} ${4:not null}\n\
  11. snippet ncol\n\
  12. ${1:name} number ${3:default 0} ${4:not null}\n\
  13. snippet dcol\n\
  14. ${1:name} date ${3:default sysdate} ${4:not null}\n\
  15. snippet ind\n\
  16. create index ${3:$1_$2} on ${1:table}(${2:column});\n\
  17. snippet uind\n\
  18. create unique index ${1:name} on ${2:table}(${3:column});\n\
  19. snippet tblcom\n\
  20. comment on table ${1:table} is '${2:comment}';\n\
  21. snippet colcom\n\
  22. comment on column ${1:table}.${2:column} is '${3:comment}';\n\
  23. snippet addcol\n\
  24. alter table ${1:table} add (${2:column} ${3:type});\n\
  25. snippet seq\n\
  26. create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${4:1};\n\
  27. snippet s*\n\
  28. select * from ${1:table}\n\
  29. ";
  30. exports.scope = "sql";
  31. });
  32. (function() {
  33. ace.require(["ace/snippets/sql"], function(m) {
  34. if (typeof module == "object" && typeof exports == "object" && module) {
  35. module.exports = m;
  36. }
  37. });
  38. })();