Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F10528947
sql.go
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
sql.go
View Options
package
converter
import
(
"database/sql"
"reflect"
)
func
SQLNullString
(
value
string
)
reflect
.
Value
{
v
:=
sql
.
NullString
{}
if
err
:=
v
.
Scan
(
value
);
err
!=
nil
{
return
reflect
.
Value
{}
}
return
reflect
.
ValueOf
(
v
)
}
func
SQLNullBool
(
value
string
)
reflect
.
Value
{
v
:=
sql
.
NullBool
{}
if
err
:=
v
.
Scan
(
value
);
err
!=
nil
{
return
reflect
.
Value
{}
}
return
reflect
.
ValueOf
(
v
)
}
func
SQLNullInt64
(
value
string
)
reflect
.
Value
{
v
:=
sql
.
NullInt64
{}
if
err
:=
v
.
Scan
(
value
);
err
!=
nil
{
return
reflect
.
Value
{}
}
return
reflect
.
ValueOf
(
v
)
}
func
SQLNullFloat64
(
value
string
)
reflect
.
Value
{
v
:=
sql
.
NullFloat64
{}
if
err
:=
v
.
Scan
(
value
);
err
!=
nil
{
return
reflect
.
Value
{}
}
return
reflect
.
ValueOf
(
v
)
}
func
ConvertSQLNullString
(
value
string
)
reflect
.
Value
{
v
:=
sql
.
NullString
{}
if
err
:=
v
.
Scan
(
value
);
err
!=
nil
{
return
reflect
.
Value
{}
}
return
reflect
.
ValueOf
(
v
)
}
func
ConvertSQLNullBool
(
value
string
)
reflect
.
Value
{
v
:=
sql
.
NullBool
{}
if
err
:=
v
.
Scan
(
value
);
err
!=
nil
{
return
reflect
.
Value
{}
}
return
reflect
.
ValueOf
(
v
)
}
func
ConvertSQLNullInt64
(
value
string
)
reflect
.
Value
{
v
:=
sql
.
NullInt64
{}
if
err
:=
v
.
Scan
(
value
);
err
!=
nil
{
return
reflect
.
Value
{}
}
return
reflect
.
ValueOf
(
v
)
}
func
ConvertSQLNullFloat64
(
value
string
)
reflect
.
Value
{
v
:=
sql
.
NullFloat64
{}
if
err
:=
v
.
Scan
(
value
);
err
!=
nil
{
return
reflect
.
Value
{}
}
return
reflect
.
ValueOf
(
v
)
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 6, 7:45 AM (8 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3185998
Attached To
rWC Write.as Web Core
Event Timeline
Log In to Comment