Skip to content

Commit 0426e49

Browse files
committed
release 1.2.4
1 parent 2540f0f commit 0426e49

File tree

4 files changed

+74
-68
lines changed

4 files changed

+74
-68
lines changed

Databasic.OracleSql.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata minClientVersion="2.6">
44
<id>Databasic.OracleSql</id>
5-
<version>1.2.0.0</version>
5+
<version>1.2.4.0</version>
66
<title>Databasic - Oracle SQL Package</title>
77
<authors>Tom Flidr</authors>
88
<owners>Tom Flidr</owners>

Databasic.OracleSql.vbproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,12 @@
127127
<PostBuildEvent>REM Create a NuGet package for this project and place the .nupkg file in the project's output directory.
128128
REM If you see this in Visual Studio's Error List window, check the Output window's Build tab for the actual error.
129129
ECHO Creating NuGet package in Post-Build event...
130-
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "&amp; '$(ProjectDir)_CreateNewNuGetPackage\DoNotModify\CreateNuGetPackage.ps1' -ProjectFilePath '$(ProjectPath)' -OutputDirectory '$(TargetDir)' -BuildConfiguration '$(ConfigurationName)' -BuildPlatform '$(PlatformName)'"</PostBuildEvent>
130+
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "&amp; '$(ProjectDir)_CreateNewNuGetPackage\DoNotModify\CreateNuGetPackage.ps1' -ProjectFilePath '$(ProjectPath)' -OutputDirectory '$(TargetDir)' -BuildConfiguration '$(ConfigurationName)' -BuildPlatform '$(PlatformName)'"
131+
132+
@set wd=%25cd%25
133+
@cd ../../../Databasic.BuildCommands
134+
@cscript.exe PostBuild.wsf "%25wd%25"
135+
@cd %25wd%25</PostBuildEvent>
131136
</PropertyGroup>
132137
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
133138
Other similar extension points exist, see Microsoft.Common.targets.

My Project/AssemblyInfo.vb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ Imports System.Runtime.InteropServices
3434
' by using the '*' as shown below:
3535
' <Assembly: AssemblyVersion("1.0.*")>
3636

37-
<Assembly: AssemblyVersion("1.2.0.0")>
38-
<Assembly: AssemblyFileVersion("1.2.0.0")>
37+
<Assembly: AssemblyVersion("1.2.4.0")>
38+
<Assembly: AssemblyFileVersion("1.2.4.0")>

ProviderResource.vb

Lines changed: 65 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
Public Class ProviderResource
22
Inherits Databasic.ProviderResource
33

4-
' TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
5-
6-
Public Overrides Function GetTableColumns(table As String, connection As Databasic.Connection) As Dictionary(Of String, Boolean)
7-
Dim result As New Dictionary(Of String, Boolean)
8-
Dim rawData As Dictionary(Of String, String) = Databasic.Statement.Prepare("
4+
Public Overrides Function GetTableColumns(table As String, connection As Databasic.Connection) As Dictionary(Of String, Boolean)
5+
Throw New NotImplementedException()
6+
Dim result As New Dictionary(Of String, Boolean)
7+
Dim rawData As Dictionary(Of String, String) = Databasic.Statement.Prepare("
98
SELECT
109
c.IS_NULLABLE,
1110
c.COLUMN_NAME
@@ -17,67 +16,69 @@
1716
ORDER BY
1817
c.ORDINAL_POSITION
1918
", connection
20-
).FetchAll(New With {
21-
.database = connection.Provider.Database,
22-
.table = table
23-
}).ToDictionary(Of String, String)("COLUMN_NAME")
24-
Dim columnCouldBenull As Boolean
25-
For Each item In rawData
26-
columnCouldBenull = item.Value.ToUpper().IndexOf("NO") = -1
27-
result.Add(item.Key, columnCouldBenull)
28-
Next
29-
Return result
30-
End Function
19+
).FetchAll(New With {
20+
.database = connection.Provider.Database,
21+
.table = table
22+
}).ToDictionary(Of String, String)("COLUMN_NAME")
23+
Dim columnCouldBenull As Boolean
24+
For Each item In rawData
25+
columnCouldBenull = item.Value.ToUpper().IndexOf("NO") = -1
26+
result.Add(item.Key, columnCouldBenull)
27+
Next
28+
Return result
29+
End Function
3130

32-
Public Overrides Function GetLastInsertedId(ByRef transaction As Databasic.Transaction, Optional ByRef classMetaDescription As MetaDescription = Nothing) As Object
33-
Return Databasic.Statement.Prepare("SELECT LAST_INSERT_ID()", transaction).FetchOne().ToInstance(Of Object)()
34-
End Function
31+
Public Overrides Function GetLastInsertedId(ByRef transaction As Databasic.Transaction, Optional ByRef classMetaDescription As MetaDescription = Nothing) As Object
32+
Throw New NotImplementedException()
33+
Return Databasic.Statement.Prepare("SELECT LAST_INSERT_ID()", transaction).FetchOne().ToInstance(Of Object)()
34+
End Function
3535

36-
'Public Overrides Function GetAll(
37-
' connection As Databasic.Connection,
38-
' columns As String,
39-
' table As String,
40-
' Optional offset As Int64? = Nothing,
41-
' Optional limit As Int64? = Nothing,
42-
' Optional orderByStatement As String = ""
43-
' ) As Databasic.Statement
44-
' Dim sql = $"SELECT {columns} FROM {table}"
45-
' offset = If(offset, 0)
46-
' limit = If(limit, 0)
47-
' If limit > 0 Then
48-
' sql += If(orderByStatement.Length > 0, " ORDER BY " + orderByStatement, "") +
49-
' $" LIMIT {If(limit = 0, "18446744073709551615", limit.ToString())} OFFSET {offset}"
50-
' End If
51-
' Return Databasic.Statement.Prepare(sql, connection).FetchAll()
52-
'End Function
36+
'Public Overrides Function GetAll(
37+
' connection As Databasic.Connection,
38+
' columns As String,
39+
' table As String,
40+
' Optional offset As Int64? = Nothing,
41+
' Optional limit As Int64? = Nothing,
42+
' Optional orderByStatement As String = ""
43+
' ) As Databasic.Statement
44+
' Dim sql = $"SELECT {columns} FROM {table}"
45+
' offset = If(offset, 0)
46+
' limit = If(limit, 0)
47+
' If limit > 0 Then
48+
' sql += If(orderByStatement.Length > 0, " ORDER BY " + orderByStatement, "") +
49+
' $" LIMIT {If(limit = 0, "18446744073709551615", limit.ToString())} OFFSET {offset}"
50+
' End If
51+
' Return Databasic.Statement.Prepare(sql, connection).FetchAll()
52+
'End Function
5353

54-
Public Overridable Function GetList(
55-
conditionSqlStatement As String,
56-
conditionParams As Object,
57-
orderBySqlStatement As String,
58-
offset As Int64?,
59-
limit As Int64?,
60-
connectionOrTransaction As Object,
61-
ByRef classMetaDescription As MetaDescription
62-
) As Databasic.Statement
63-
Dim columns As String = String.Join(",", Databasic.ProviderResource.ColumnsArray(classMetaDescription.ClassType, 0))
64-
Dim sql As String = $"SELECT {columns} FROM {ActiveRecord.Resource.Table(classMetaDescription)}"
65-
Dim params As Object = Nothing
66-
If Not String.IsNullOrEmpty(conditionSqlStatement) Then
67-
sql += " WHERE " + conditionSqlStatement
68-
params = conditionParams
69-
End If
70-
If Not String.IsNullOrEmpty(orderBySqlStatement) Then
71-
sql += " ORDER BY " + orderBySqlStatement
72-
End If
73-
If offset.HasValue Then
74-
' offset a number, but could be 0, limit is unknown
75-
sql += $" LIMIT {If(Not limit.HasValue, "18446744073709551615", limit.ToString())} OFFSET {offset}"
76-
ElseIf limit.HasValue And limit > 0 Then
77-
' offset is null, limit is a number, but could be 0
78-
sql += $" LIMIT {limit.ToString()}"
79-
End If
80-
Return Databasic.Statement.Prepare(sql, connectionOrTransaction).FetchAll(params)
81-
End Function
54+
Public Overridable Function GetList(
55+
conditionSqlStatement As String,
56+
conditionParams As Object,
57+
orderBySqlStatement As String,
58+
offset As Int64?,
59+
limit As Int64?,
60+
connectionOrTransaction As Object,
61+
ByRef classMetaDescription As MetaDescription
62+
) As Databasic.Statement
63+
Throw New NotImplementedException()
64+
Dim columns As String = String.Join(",", Databasic.ProviderResource.ColumnsArray(classMetaDescription.ClassType, 0))
65+
Dim sql As String = $"SELECT {columns} FROM {ActiveRecord.Resource.Table(classMetaDescription)}"
66+
Dim params As Object = Nothing
67+
If Not String.IsNullOrEmpty(conditionSqlStatement) Then
68+
sql += " WHERE " + conditionSqlStatement
69+
params = conditionParams
70+
End If
71+
If Not String.IsNullOrEmpty(orderBySqlStatement) Then
72+
sql += " ORDER BY " + orderBySqlStatement
73+
End If
74+
If offset.HasValue Then
75+
' offset a number, but could be 0, limit is unknown
76+
sql += $" LIMIT {If(Not limit.HasValue, "18446744073709551615", limit.ToString())} OFFSET {offset}"
77+
ElseIf limit.HasValue And limit > 0 Then
78+
' offset is null, limit is a number, but could be 0
79+
sql += $" LIMIT {limit.ToString()}"
80+
End If
81+
Return Databasic.Statement.Prepare(sql, connectionOrTransaction).FetchAll(params)
82+
End Function
8283

8384
End Class

0 commit comments

Comments
 (0)