sqls

package
v0.0.0-...-df226ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateTableSqls = []string{
	`CREATE TABLE IF NOT EXISTS users (
		id textll not null primary key, 
		name text default 'New User',
		password text not null,
		mobile text default '',
		email text not null,
		priv text not null,
		avatar_url text default '',
		last_login_date timestamp DEFAULT CURRENT_TIMESTAMP
	);
	CREATE INDEX index_name
		ON users (name);
	INSERT INTO users (id,name,password,priv,email) VALUES ('admin','admin','admin','super_admin','cto@188.com');
	`,

	`CREATE TABLE IF NOT EXISTS sessions (
		sid              text primary key,   
		user_id          text
	);
	`,
}

go and sqlite types compare |int | integer | |int64 | integer | |float64 | float | |bool | integer | |[]byte | blob | |string | text | |time.Time | timestamp/datetime Tutorial: https://www.runoob.com/sqlite/sqlite-index.html

View Source
var DropTableSqls = []string{
	`drop table users`,
	`drop table sessions`,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL