-
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.
- Loading branch information
Alexander Lavrukov
committed
Feb 15, 2024
1 parent
51c3007
commit 14a6948
Showing
25 changed files
with
106 additions
and
81 deletions.
There are no files selected for viewing
47 changes: 29 additions & 18 deletions
47
...a/tech/ydb/yoj/repository/ydb/DbType.java → ...in/java/tech/ydb/yoj/databind/DbType.java
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,87 +1,98 @@ | ||
package tech.ydb.yoj.repository.ydb; | ||
package tech.ydb.yoj.databind; | ||
|
||
/** | ||
* Database column types supported by YDB. | ||
*/ | ||
public interface DbType { | ||
public enum DbType { | ||
DEFAULT(""), | ||
/** | ||
* Boolean value. | ||
*/ | ||
String BOOL = "BOOL"; | ||
BOOL("BOOL"), | ||
|
||
/** | ||
* Byte value. | ||
*/ | ||
String UINT8 = "UINT8"; | ||
UINT8("UINT8"), | ||
|
||
/** | ||
* Integer value. | ||
*/ | ||
String INT32 = "INT32"; | ||
INT32("INT32"), | ||
|
||
/** | ||
* Integer value stored in the db as Uint32. | ||
*/ | ||
String UINT32 = "UINT32"; | ||
UINT32("UINT32"), | ||
|
||
/** | ||
* Long value. | ||
*/ | ||
String INT64 = "INT64"; | ||
INT64("INT64"), | ||
|
||
/** | ||
* Long value stored in the db as Uint64. | ||
*/ | ||
String UINT64 = "UINT64"; | ||
UINT64("UINT64"), | ||
|
||
/** | ||
* Float value. | ||
*/ | ||
String FLOAT = "FLOAT"; | ||
FLOAT("FLOAT"), | ||
|
||
/** | ||
* Double value. | ||
*/ | ||
String DOUBLE = "DOUBLE"; | ||
DOUBLE("DOUBLE"), | ||
|
||
/** | ||
* Date value, accurate to the day. | ||
*/ | ||
String DATE = "DATE"; | ||
DATE("DATE"), | ||
|
||
/** | ||
* Timestamp value, accurate to second. | ||
*/ | ||
String DATETIME = "DATETIME"; | ||
DATETIME("DATETIME"), | ||
|
||
/** | ||
* Timestamp value, accurate to microsecond. | ||
*/ | ||
String TIMESTAMP = "TIMESTAMP"; | ||
TIMESTAMP("TIMESTAMP"), | ||
|
||
/** | ||
* Interval value, accurate to microsecond. | ||
*/ | ||
String INTERVAL = "INTERVAL"; | ||
INTERVAL("INTERVAL"), | ||
|
||
/** | ||
* Binary data. | ||
*/ | ||
String STRING = "STRING"; | ||
STRING("STRING"), | ||
|
||
/** | ||
* UTF-8 encoded string. | ||
*/ | ||
String UTF8 = "UTF8"; | ||
UTF8("UTF8"), | ||
|
||
/** | ||
* JSON value, stored as a UTF-8 encoded string. | ||
*/ | ||
String JSON = "JSON"; | ||
JSON("JSON"), | ||
|
||
/** | ||
* JSON value, stored in an indexed representation permitting efficient query operations of the values inside the | ||
* JSON value itself. | ||
*/ | ||
String JSON_DOCUMENT = "JSON_DOCUMENT"; | ||
JSON_DOCUMENT("JSON_DOCUMENT"); | ||
|
||
private final String dbType; | ||
|
||
DbType(String dbType) { | ||
this.dbType = dbType; | ||
} | ||
|
||
public String getDbType() { | ||
return dbType; | ||
} | ||
} |
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
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
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
3 changes: 2 additions & 1 deletion
3
repository-ydb-v1/src/main/java/tech/ydb/yoj/repository/ydb/statement/Count.java
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,10 +1,11 @@ | ||
package tech.ydb.yoj.repository.ydb.statement; | ||
|
||
import lombok.Value; | ||
import tech.ydb.yoj.databind.DbType; | ||
import tech.ydb.yoj.databind.schema.Column; | ||
|
||
@Value | ||
public class Count { | ||
@Column(dbType = "UINT64") | ||
@Column(dbType = DbType.UINT64) | ||
long 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
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.