rustyroad 1.8.0

Rusty Road is a framework written in Rust that is based on Ruby on Rails. It is designed to provide the familiar conventions and ease of use of Ruby on Rails, while also taking advantage of the performance and efficiency of Rust.
Documentation
//! Column builders for the fixture tables.

use crate::database::introspection::Column;

/// Builds a nullable column with no default.
pub(in crate::generators::rust::tests) fn column(name: &str, sql_type: &str) -> Column {
    Column {
        name: name.to_string(),
        sql_type: sql_type.to_string(),
        nullable: true,
        default: None,
        auto_increment: false,
    }
}

/// Builds a non-nullable column.
pub(in crate::generators::rust::tests) fn required(name: &str, sql_type: &str) -> Column {
    Column {
        nullable: false,
        ..column(name, sql_type)
    }
}

/// Builds a serial primary key column.
pub(in crate::generators::rust::tests) fn serial_key(name: &str) -> Column {
    Column {
        nullable: false,
        auto_increment: true,
        default: Some("nextval('products_id_seq'::regclass)".to_string()),
        ..column(name, "integer")
    }
}