-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Christopher White <[email protected]>
- Loading branch information
1 parent
dd90576
commit 118c9a8
Showing
41 changed files
with
527 additions
and
591 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
package dev.pgm.community.database; | ||
|
||
import static com.google.common.base.Preconditions.checkNotNull; | ||
import static tc.oc.pgm.util.Assert.assertNotNull; | ||
|
||
public class Query { | ||
|
||
public static String createTable(String tableName, String fields) { | ||
checkNotNull(tableName); | ||
checkNotNull(fields); | ||
assertNotNull(tableName); | ||
assertNotNull(fields); | ||
|
||
return String.format("CREATE TABLE IF NOT EXISTS %s %s", tableName, fields); | ||
} | ||
|
||
public static String countTable(String tableName) { | ||
checkNotNull(tableName); | ||
assertNotNull(tableName); | ||
return String.format("SELECT count(*) from %s", tableName); | ||
} | ||
} |
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
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
Oops, something went wrong.