Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Wagner Andrade
committed
Aug 22, 2012
1 parent
74416dd
commit 7823bd9
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Thunderstruck.Provider; | ||
|
||
namespace Thunderstruck.Provider.Common | ||
{ | ||
public class MySqlProvider : DefaultProvider | ||
{ | ||
public override int ExecuteGetIdentity(string command, object commandParams) | ||
{ | ||
var identityQuery = String.Concat(command, "; SELECT last_insert_id();"); | ||
var value = CreateDbCommand(identityQuery, commandParams).ExecuteScalar(); | ||
return Convert.ToInt32(value); | ||
|
||
throw new NotImplementedException(); | ||
} | ||
|
||
public override string FieldFormat | ||
{ | ||
get { return "`{0}`"; } | ||
} | ||
|
||
public override string ParameterIdentifier | ||
{ | ||
get { return "@"; } | ||
} | ||
|
||
public override string SelectAllQuery(string projection, string where) | ||
{ | ||
return String.Format("SELECT {0} {1}", projection, where); | ||
} | ||
|
||
public override string SelectTakeQuery(string projection, string where, int count) | ||
{ | ||
return String.Format("SELECT {0} {1} LIMIT {2}", projection, where, count); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters