[−][src]Struct ena::pgsql::core::Post
The schema for each row.
This is just for documentation.
Optimized specifically for Postgres by using column tetris to save space.
The original schema is used as a base with reasonable changes made.
Added
subnum
For ghost postsdeleted_on
For contextlast_modified
For context and possible use of search enginessha256
For file dedup and to prevent MD5 collisionssha256t
For thumbnail dedup and to prevent MD5 collisionsextra
For any future schema changes
Removed
now
Redundant withtime
archived
Redundant witharchived_on
Modified
md5
From base64 to binary, to save spacecountry
Usetroll_country
ifcountry
isNULL
- To
bool
, to save space
Side notes
Postgres doesn't have a numeric smaller than i16
or unsigned integers.
For example: custom_spoiler
should ideally
be u8
.
SQL table query
Table "asagi.a"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
----------------+----------+-----------+----------+---------+----------+--------------+-------------
no | bigint | | not null | | plain | |
subnum | bigint | | | | plain | |
tim | bigint | | | | plain | |
resto | bigint | | not null | 0 | plain | |
time | bigint | | not null | 0 | plain | |
last_modified | bigint | | | | plain | |
archived_on | bigint | | | | plain | |
deleted_on | bigint | | | | plain | |
fsize | integer | | | | plain | |
w | integer | | | | plain | |
h | integer | | | | plain | |
replies | integer | | | | plain | |
images | integer | | | | plain | |
unique_ips | integer | | | | plain | |
tn_w | smallint | | | | plain | |
tn_h | smallint | | | | plain | |
custom_spoiler | smallint | | | | plain | |
since4pass | smallint | | | | plain | |
sticky | boolean | | | | plain | |
closed | boolean | | | | plain | |
filedeleted | boolean | | | | plain | |
spoiler | boolean | | | | plain | |
m_img | boolean | | | | plain | |
bumplimit | boolean | | | | plain | |
imagelimit | boolean | | | | plain | |
name | text | | | | extended | |
sub | text | | | | extended | |
com | text | | | | extended | |
filename | text | | | | extended | |
ext | text | | | | extended | |
trip | text | | | | extended | |
id | text | | | | extended | |
capcode | text | | | | extended | |
country | text | | | | extended | |
country_name | text | | | | extended | |
semantic_url | text | | | | extended | |
tag | text | | | | extended | |
md5 | bytea | | | | extended | |
sha256 | bytea | | | | extended | |
sha256t | bytea | | | | extended | |
extra | jsonb | | | | extended | |
Indexes:
"unq_idx_no_subnum_a" UNIQUE, btree (no, COALESCE(subnum, 0::bigint))
"idx_a_no_resto" btree (no, resto)
"idx_a_time" btree (((floor(("time" / 86400)::double precision) * '86400'::double precision)::bigint))
"trgm_idx_a_com" gin (com asagi.gin_trgm_ops)
The following below is taken from the official docs where applicable.
Fields
no: i64
Appears: always
Possible values: any positive integer
> The numeric post ID
subnum: Option<i64>
Appears: always if post is a ghost post
Possible values: any positive integer
> Used in FF for ghost posting
tim: Option<i64>
Appears: always if post has attachment
Possible values: integer
> Unix timestamp + microtime that an image was
uploaded
resto: i64
Appears: always
Possible values: 0
or any positive integer
> For replies: this is the ID of the thread being replied
to. For OP: this value is zero
time: i64
Appears: always
Possible values: UNIX timestamp
> UNIX timestamp the post was created
last_modified: i64
Appears: always
Possible values: UNIX timestamp
> UNIX timestamp the post had any of its fields
modified
archived_on: Option<i64>
Appears: OP only, if thread has been archived
Possible values: UNIX timestamp
> UNIX timestamp the post was archived
deleted_on: Option<i64>
Appears: always if post has been deleted
Possible values: UNIX timestamp
> UNIX timestamp the post was deleted
fsize: Option<i32>
Appears: always if post has attachment
Possible values: any positive integer
> Size of uploaded file in bytes
w: Option<i32>
Appears: always if post has attachment
Possible values: any positive integer
> Image width dimension
h: Option<i32>
Appears: always if post has attachment
Possible values: any positive integer
> Image height dimension
replies: Option<i32>
Appears: OP only
Possible values: 0
or any positive integer
> Total number of replies to a thread
images: Option<i32>
Appears: OP only
Possible values: 0
or any positive integer
> Total number of image replies to a thread
unique_ips: Option<i32>
Appears: OP only, only if thread has NOT been archived
Possible values: any positive integer
> Number of unique posters in a thread
tn_w: Option<i16>
Appears: always if post has attachment
Possible values: any positive integer
> Thumbnail image width dimension
tn_h: Option<i16>
Appears: always if post has attachment
Possible values: any positive integer
> Thumbnail image height dimension
custom_spoiler: Option<i16>
Appears: if post has attachment and attachment is spoilered
Possible values: 1-10
or not set
> The custom spoiler ID for a spoilered image
since4pass: Option<i16>
Appears: if poster put 'since4pass' in the options field
Possible values: any 4 digit year
> Year 4chan pass bought
sticky: Option<bool>
Appears: OP only, if thread is currently stickied
Possible values: 1
or not set
> If the thread is being pinned to the top of the page
closed: Option<bool>
Appears: OP only, if thread is currently closed
Possible values: 1
or not set
> If the thread is closed to replies
filedeleted: Option<bool>
Appears: if post had attachment and attachment is deleted
Possible values: 1
or not set
> If the file was deleted from the post
spoiler: Option<bool>
Appears: if post has attachment and attachment is spoilered
Possible values: 1
or not set
> If the image was spoilered or not
m_img: Option<bool>
Appears: any post that has a mobile-optimized image
Possible values: 1
or not set
> Mobile optimized image exists for post
bumplimit: Option<bool>
Appears: OP only, only if bump limit has been reached
Possible values: 1
or not set
> If a thread has reached bumplimit, it will no longer bump
imagelimit: Option<bool>
Appears: OP only, only if image limit has been reached
Possible values: 1
or not set
> If an image has reached image limit, no more image replies can be made
name: Option<String>
Appears: always
Note: Can be empty if user has a tripcode and opted out of a name
Possible values: any string
> Name user posted with. Defaults to Anonymous
sub: Option<String>
Appears: OP only, if subject was included
Possible values: any string
> OP Subject text
com: Option<String>
Appears: if comment was included
Possible values: any HTML escaped string
> Comment (HTML escaped)
filename: Option<String>
Appears: always if post has attachment
Possible values: any string
> Filename as it appeared on the poster's device
ext: Option<String>
Appears: always if post has attachment
Possible values: .jpg
, .png
, .gif
, .pdf
, .swf
, .webm
> Filetype
trip: Option<String>
Appears: if post has tripcode
Possible values: any string
> The user's tripcode, in format: !tripcode
or !!securetripcode
id: Option<String>
Appears: if post has ID
Possible values: any 8 characters
> The poster's ID
capcode: Option<String>
Appears: if post has capcode
Possible values: Not set, mod
, admin
, admin_highlight
, manager
, developer
, founder
> The capcode identifier for a post
country: Option<String>
Appears: if country flags are enabled
Possible values: 2 character string
or XX
if unknown or troll_country
if present
> Poster's ISO 3166-1 alpha-2 country code
country_name: Option<String>
Appears: Name of any country
Possible values: any string
> Poster's country name
semantic_url: Option<String>
Appears: OP only
Possible values: string
> SEO URL slug for thread
tag: Option<String>
Appears: OP only
, /f/ only
Possible values: Game
, Loop
, etc..
> The category of .swf
upload
md5: Option<Vec<u8>>
Appears: always if post has attachment
Possible values:
> 24 character (base64), decoded binary MD5 hash of file
sha256: Option<Vec<u8>>
Appears: always if post has attachment
Possible values:
> 65 character (hex), binary SHA256 hash of file
sha256t: Option<Vec<u8>>
Appears: always if post has thumbnail attachment
, excludes /f/
Possible values:
> 65 character (hex), binary SHA256 hash of thumbnail
extra: Option<Value>
Appears:
Possible values:
> Optional field for extra column additions
Trait Implementations
impl Clone for Post
[src]
impl Debug for Post
[src]
impl Default for Post
[src]
impl<'de> Deserialize<'de> for Post where
Post: Default,
[src]
Post: Default,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for Post
[src]
Auto Trait Implementations
impl RefUnwindSafe for Post
impl Send for Post
impl Sync for Post
impl Unpin for Post
impl UnwindSafe for Post
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,