Skip to content

Commit 78852cf

Browse files
committed
back in shape to get data from database, default getters by primary index attributes and by unique index attribute not implemented yet
1 parent 137297c commit 78852cf

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Resource.vb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ Public Class Resource
55

66
Public Overrides Function GetTableColumns(connection As Databasic.Connection, table As String) As List(Of String)
77
Dim result As New List(Of String)
8-
Return Databasic.Statement.Prepare(
9-
"SELECT c.COLUMN_NAME
8+
Return Databasic.Statement.Prepare(
9+
"SELECT c.COLUMN_NAME
1010
FROM INFORMATION_SCHEMA.COLUMNS AS c
1111
WHERE
1212
c.TABLE_SCHEMA = @database AND
1313
c.TABLE_NAME = @table
1414
ORDER BY c.ORDINAL_POSITION",
15-
connection
16-
).FetchAll(New With {
17-
.database = connection.Provider.Database,
18-
.table = table
19-
}).ToList(Of String)()
20-
End Function
15+
connection
16+
).FetchAll(New With {
17+
.database = connection.Provider.Database,
18+
.table = table
19+
}).ToList(Of String)()
20+
End Function
2121

2222
Public Overrides Function GetLastInsertedId(transaction As Databasic.Transaction) As Object
23-
Return Databasic.Statement.Prepare("SELECT LAST_INSERT_ID()", transaction).FetchOne().ToValue(Of Object)()
24-
End Function
23+
Return Databasic.Statement.Prepare("SELECT LAST_INSERT_ID()", transaction).FetchOne().ToInstance(Of Object)()
24+
End Function
2525

2626
Public Overrides Function GetAll(
2727
connection As Databasic.Connection,
@@ -38,7 +38,7 @@ Public Class Resource
3838
sql += If(orderByStatement.Length > 0, " ORDER BY " + orderByStatement, "") +
3939
$" LIMIT {If(limit = 0, "18446744073709551615", limit.ToString())} OFFSET {offset}"
4040
End If
41-
Return Statement.Prepare(sql, connection).FetchAll()
42-
End Function
41+
Return Databasic.Statement.Prepare(sql, connection).FetchAll()
42+
End Function
4343

4444
End Class

0 commit comments

Comments
 (0)