Browse code

Replace 'com.hacking.cl-mysql' with alias 'cl-mysql'

Jaidyn Lev authored on 2018-06-14 04:00:09
Showing 1 changed files
... ...
@@ -1,16 +1,17 @@
1 1
 (in-package :simple-sql)
2 2
 
3
+
3 4
 (defun init (database)
4 5
   "Initializes the mySQL database."
5 6
 
6
-  (com.hackinghat.cl-mysql:connect)
7
-  (com.hackinghat.cl-mysql:use database))
7
+  (cl-mysql:connect)
8
+  (cl-mysql:use database))
8 9
 
9 10
 
10 11
 (defun fetch (table query)
11 12
   "Fetches a set query from a table."
12 13
 
13
-  (com.hackinghat.cl-mysql:query
14
+  (cl-mysql:query
14 15
   (concatenate `string
15 16
                "select " query " from " table)))
16 17
 
... ...
@@ -19,7 +20,7 @@
19 20
   "Fetches a specific row-- using 'where variable == value' to select the row.
20 21
   Returns the query."
21 22
 
22
-  (com.hackinghat.cl-mysql:query
23
+  (cl-mysql:query
23 24
   (concatenate `string
24 25
 	"select " query " from " table " where " variable "=" value ";")))
25 26
 
... ...
@@ -27,7 +28,7 @@
27 28
 (defun insert-row (table &rest values)
28 29
   "Inserts a new row into a table."
29 30
 
30
-  (com.hackinghat.cl-mysql:query
31
+  (cl-mysql:query
31 32
   (concatenate `string
32 33
                "insert into " table " values ("
33 34
                 (apply 'comma-seperate values)
... ...
@@ -37,7 +38,7 @@
37 38
 (defun switch-where (table variable value modded-variable modded-value)
38 39
   "Replaces one value of one row in one table with another value. :-)"
39 40
 
40
-  (com.hackinghat.cl-mysql:query
41
+  (cl-mysql:query
41 42
   (concatenate `string
42 43
                "update " table " set " modded-variable " = " modded-value
43 44
 		" where " variable " = " value ";")))
... ...
@@ -47,7 +48,7 @@
47 48
   "Completely deletes row from table (using 'where variable == value' to select
48 49
   the row."
49 50
 
50
-  (com.hackinghat.cl-mysql:query
51
+  (cl-mysql:query
51 52
   (concatenate `string
52 53
                "delete from " table " where " variable " = " value ";")))
53 54
 
... ...
@@ -55,7 +56,7 @@
55 56
 (defun database-create (database)
56 57
   "Creates a new database."
57 58
 
58
-  (com.hackinghat.cl-mysql:query "create database " database))
59
+  (cl-mysql:query "create database " database))
59 60
 
60 61
 (defun comma-seperate (&rest values)
61 62
   "Creates a string made up of all values seperated by commas."
... ...
@@ -65,6 +66,9 @@
65 66
                                              (string-sanitize
66 67
                                                (format nil "~A" x)))) values))))
67 68
 
69
+(defun string-sanitize (string)
70
+  (format nil "~A" string))
71
+
68 72
 (defun replace-all (string part replacement &key (test #'char=))
69 73
   "Returns a new string in which all the occurences of the part 
70 74
   is replaced with replacement.
... ...
@@ -129,3 +133,4 @@
129 133
         (setq overarching-list (cdr overarching-list)))
130 134
 
131 135
 	overarching-resultant-list))
136
+