v/tutorials/Building a simple web blog .../code/blog/article.ve

14 lines
196 B
Plaintext
Raw Normal View History

2019-12-14 03:31:09 +01:00
module main
struct Article {
id int [primary; sql: serial]
2019-12-14 03:31:09 +01:00
title string
text string
}
pub fn (app &App) find_all_articles() []Article {
2020-06-30 21:04:00 +02:00
return sql app.db {
2020-07-04 18:56:18 +02:00
select from Article
2020-06-30 21:04:00 +02:00
}
2019-12-14 03:31:09 +01:00
}