Added persistence support for Eiffel sqlite3 wrapper.
Updated existing persistency solution to be more generic to any db solution.
This commit is contained in:
@@ -33,11 +33,15 @@ feature -- Access User Outh
|
||||
l_parameters.put (a_uid, "uid")
|
||||
l_parameters.put (a_identity, "identity")
|
||||
sql_query (Select_user_openid_by_id, l_parameters)
|
||||
if sql_rows_count = 1 then
|
||||
if not has_error and not sql_after then
|
||||
Result := fetch_user
|
||||
else
|
||||
check no_more_than_one: sql_rows_count = 0 end
|
||||
sql_forth
|
||||
if not sql_after then
|
||||
check no_more_than_one: False end
|
||||
Result := Void
|
||||
end
|
||||
end
|
||||
sql_finalize
|
||||
end
|
||||
|
||||
user_openid_by_identity (a_identity: READABLE_STRING_GENERAL): detachable CMS_USER
|
||||
@@ -50,10 +54,15 @@ feature -- Access User Outh
|
||||
create l_parameters.make (1)
|
||||
l_parameters.put (a_identity, "identity")
|
||||
sql_query (Select_user_by_openid_identity, l_parameters)
|
||||
if sql_rows_count = 1 then
|
||||
if not has_error and not sql_after then
|
||||
Result := fetch_user
|
||||
sql_forth
|
||||
if not sql_after then
|
||||
check no_more_than_one: False end
|
||||
Result := Void
|
||||
end
|
||||
else
|
||||
check no_more_than_one: sql_rows_count = 0 end
|
||||
check no_more_than_one: False end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -91,11 +100,14 @@ feature --Access: Consumers
|
||||
create l_parameters.make (1)
|
||||
l_parameters.put (a_name, "name")
|
||||
sql_query (sql_openid_consumer_name, l_parameters)
|
||||
if sql_rows_count = 1 then
|
||||
if not has_error and not sql_after then
|
||||
Result := fetch_consumer
|
||||
else
|
||||
check no_more_than_one: sql_rows_count = 0 end
|
||||
sql_forth
|
||||
if not sql_after then
|
||||
check no_more_than_one: False end
|
||||
end
|
||||
end
|
||||
sql_finalize
|
||||
end
|
||||
|
||||
feature -- Change: User OAuth
|
||||
@@ -114,7 +126,7 @@ feature -- Change: User OAuth
|
||||
l_parameters.put (a_user.id, "uid")
|
||||
l_parameters.put (a_identity, "identity")
|
||||
l_parameters.put (create {DATE_TIME}.make_now_utc, "utc_date")
|
||||
sql_change (Sql_insert_openid, l_parameters)
|
||||
sql_insert (Sql_insert_openid, l_parameters)
|
||||
sql_commit_transaction
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user