55 lines
1 KiB
Zig
55 lines
1 KiB
Zig
const std = @import("std");
|
|
|
|
/// Structure of a field column.
|
|
pub const FieldColumn = struct {
|
|
name: ?[]const u8 = null,
|
|
type: ?[]const u8 = null,
|
|
};
|
|
|
|
/// Type of an integer field.
|
|
pub const Int = struct {
|
|
column: FieldColumn = .{},
|
|
type: type = i64,
|
|
};
|
|
|
|
/// Type of a serial field.
|
|
pub const Serial = struct {
|
|
column: FieldColumn = .{},
|
|
type: type = i64,
|
|
};
|
|
|
|
/// Type of a float field.
|
|
pub const Float = struct {
|
|
column: FieldColumn = .{},
|
|
type: type = f64,
|
|
};
|
|
|
|
/// Type of a decimal (fixed point) field.
|
|
pub const Decimal = struct {
|
|
column: FieldColumn = .{},
|
|
type: type = []const u8,
|
|
};
|
|
|
|
/// Type of a string field.
|
|
pub const String = struct {
|
|
column: FieldColumn = .{},
|
|
type: type = []const u8,
|
|
};
|
|
|
|
/// Type of a datetime field.
|
|
pub const DateTime = struct {
|
|
column: FieldColumn = .{},
|
|
type: type = []const u8, //TODO maybe something else?
|
|
};
|
|
|
|
/// Type of a JSON field.
|
|
pub const Json = struct {
|
|
column: FieldColumn = .{},
|
|
type: type,
|
|
};
|
|
|
|
/// Type of an array field.
|
|
pub const Array = struct {
|
|
column: FieldColumn = .{},
|
|
type: type,
|
|
};
|