mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
tutorial: minor fixes + move code and images to a separate dir
This commit is contained in:
parent
1cd5fab21d
commit
94de493b37
7 changed files with 2 additions and 1 deletions
17
tutorials/code/blog/article.v
Normal file
17
tutorials/code/blog/article.v
Normal file
|
@ -0,0 +1,17 @@
|
|||
module main
|
||||
|
||||
struct Article {
|
||||
id int
|
||||
title string
|
||||
text string
|
||||
}
|
||||
|
||||
pub fn (app &App) find_all_articles() []Article {
|
||||
db := app.db
|
||||
articles := db.select from Article
|
||||
return articles
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue