Slide 1

Slide 1 text

EHX (FOFSBUJOH(PTUSVDU GSPN1PTUHSF42- HPMBOHUPLZP+VM "LJSB$IJLV

Slide 2

Slide 2 text

NF /BNF"LJSB$IJLV 5XJUUFS!@BDIJLV (JU)VC!BDIJLV (PPHMF4FBSDI"LJSB$IJLV'JSF

Slide 3

Slide 3 text

BHFOEB Ø  #BDLHSPVOE Ø  8IBU Ø  8IZ Ø  )PX

Slide 4

Slide 4 text

CBDLHSPVOE

Slide 5

Slide 5 text

CBDLHSPVOE QSPEVDU Ø  QSPEVDU Ø  "QQCBTFEJOTUBOU BOESFMPBEBCMFWJSUVBMQMBTUJD 7*4"QSFQBJEDBSEGPSFWFSZPOF Ø  J04 "OESPJE Ø  IUUQTWBOEMFKQ

Slide 6

Slide 6 text

CBDLHSPVOE QSPEVDUTJ[F Ø  TJ[F BTPG+VM Ø  PGFOEQPJOUT JOUFSOBM"1* Ø  PGFYUFSOBMTFSWJDFT Ø  OPUJODMVEJOH4FOUSZ/FX3FMJD4UBUVT1BHFJP Ø  PGUBCMFT 1PTUHSF42- Ø  PGMJOFT (PDPEFXJUIPVUWFOEPSEJS Ø  5PUBM Ø  8JUIPVUUFTUDPEF

Slide 7

Slide 7 text

XIBU

Slide 8

Slide 8 text

EHX Ø  IUUQTHJUIVCDPNBDIJLVEHX Ø  *UHFOFSBUFT(PTUSVDU BOETJNQMF5BCMF3PX%BUB(BUFXBZ GVODUJPOTNFUIPETGSPN1PTUHSF42-UBCMFEFOJUJPOT Ø  5BCMF3PX%BUB(BUFXBZ Ø  1SJNJUJWFGPSNPGNBQQJOHCFUXFFO(PBOE3%#.4 UBCMFBOESPX OPUMJLF"DUJWF3FDPSE%BUB.BQQFS Ø  IUUQTNBSUJOGPXMFSDPNFBB$BUBMPHUBCMF%BUB(BUFXBZIUNM Ø  IUUQTNBSUJOGPXMFSDPNFBB$BUBMPHSPX%BUB(BUFXBZIUNM Ø  VTFS@BDDPVOUUBCMF6TFS"DDPVOUTUSVDU Ø  AUZQF6TFS"DDPVOUTUSVDUAXJUIA*%A A&NBJMA A-BTU/BNFA BOEA'JSTU/BNFABUUSJCVUFT Ø  A6TFS"DDPVOU$SFBUF 2VFSZFS ANFUIPEUPJOTFSU SFDPSE Ø  A(FU6TFS"DDPVOU#Z1L QLJOU AGVODUJPOUPTFMFDU SFDPSECZQL

Slide 9

Slide 9 text

&YBNQMF CREATE TABLE user_account ( id bigserial primary key , email text not null unique , last_name text not null , first_name text not null );

Slide 10

Slide 10 text

// UserAccount represents public.user_account type UserAccount struct { ID int64 // id Email string // email LastName string // last_name FirstName string // first_name } // Create inserts the UserAccount to the database. func (r *UserAccount) Create(db Queryer) error { err := db.QueryRow( `INSERT INTO user_account (email, last_name, first_name) VALUES ($1, $2, $3) RETURNING id`, &r.Email, &r.LastName, &r.FirstName).Scan(&r.ID) if err != nil { return errors.Wrap(err, "failed to insert user_account") } return nil } // GetUserAccountByPk select the UserAccount from the database. func GetUserAccountByPk(db Queryer, pk0 int64) (*UserAccount, error) { var r UserAccount err := db.QueryRow( `SELECT id, email, last_name, first_name FROM user_account WHERE id = $1`, pk0).Scan(&r.ID, &r.Email, &r.LastName, &r.FirstName) if err != nil { return nil, errors.Wrap(err, "failed to select user_account") } return &r, nil }

Slide 11

Slide 11 text

4JNJMBSBQQSPBDI Ø  YP Ø  IUUQTHJUIVCDPNLORYP Ø  4VQQPSUJOH1PTUHSF42-.Z42-0SBDMF.442-4FSWFS 42-JUF Ø  EHXJTIFBWJMZJOTQJSFECZYP Ø  TRMCPJMFS Ø  IUUQTHJUIVCDPNWBUUMFTRMCPJMFS Ø  4VQQPSUJOH1PTUHSF42-.Z42-.442-4FSWFS Ø  3BJMTTUZMF EBUBCBTFSTU03.

Slide 12

Slide 12 text

'FBUVSF Ø  EHXDBOQSPQFSMZEFUFDUDPNQPTJUFQSJNBSZLFZT BOEBVUP HFOFSBUJOHDPMVNOT Ø  SFUVOJOHBVUPHFOFSBUFEAVVJEA ACJHTFSJBMA FUD Ø  EHXIBTDPOHVSBCMFUZQFNBQQJOHCFUXFFO1PTUSHF42-BOE (P Ø  EHXQSPWJEFTDVTUPNUFNQMBUFGFBUVSF Ø  EFWFMPQFSTDBOVTFUIFJSPXOUFNQMBUFGPSTUSVDU NFUIPE BOEGVODUJPO

Slide 13

Slide 13 text

/PU'FBUVSF Ø  EHXEPFTOUDBSFBCPVUSFMBUJPOT Ø  POMZTUSVDUXJUIA$SFBUFANFUIPE BOEGVODUJPOXIJDI TFMFDUTSPXCZ1,BSFHFOFSBUFE Ø  *UTUBZTCFJOHNJOJNBMUBCMFSPXEBUBHBUFXBZ Ø  EHXPOMZTVQQPSUT1PTUHSF42- Ø  XFBSFDVSSFOUMZOPUVTJOHPUIFS3%#.4PUIFSUIBO 1PTUHSF42-

Slide 14

Slide 14 text

XIZ

Slide 15

Slide 15 text

"CJUPGIJTUPSZ Ø  8FSTUTUBSUFECVJMEJOHUIFQSPEVDUXJUIIBOEDSBGUFESBX42- Ø  CBDLJO (PCBTFE DPEFSTU03.MJCSBSJFTBSFCJUTIBLZ Ø  SFFDUJPOTFWFSZXIFSF HFOFSBUFE42-OPUBMXBZFDJFOU Ø  TJODF*DBNFGSPN%KBOHP03. 42-"MDIFNZXPSME *LOPX 03.JTHSFBUJONBOZXBZT Ø  CVU*UIPVHIUNBZCFDPEFSTU03.JTOPUGPS(PBUUIBU NPNFOU Ø  TUBSUFEXSJUJOHSBX42-GPSPVSQSPEVDU Ø  NPRBEB BOE*GFMUQSFUUZDPOEFOUXSJUJOHDPNQMFY42- Ø  IPXFWFS JUXBTFYUSFNFMZSFQFUJUJWF CPSJOH BOEFSSPSQSPOFUP DSFBUFTJNQMF42- Ø  QSPCMFNXBTOPUDPNQMFY42- CVUSBUIFSTJNQMF BOETNBMM42- XJUIMPUTPGDPMVNOT Ø  BUUIFTBNFUJNF XFBQQSFDJBUFEIPX03.IBWFCFFOTBWJOHPVS UJNF

Slide 16

Slide 16 text

%FOFQSPCMFN Ø  %FOFQSPCMFNXIJDIXFTIPVMETPMWF Ø  NBOVBMMZXSJUJOHJOTFSUSPXTFMFDUCZQL42-BSFFWJM Ø  DPMT BSHT BOEQMBDFIPMEFSTIBWFUPCFFYBDUMZJOPSEFS Ø  UIFNPTUGSFRVFOUQBUUFSO JOPVSQSPEVDU JODMVEJOH UFTUEBUBQSFQBSBUJPO Ø  TJODFPVSQSPEVDUEPFTOUZFUSFBMMZIBWFBOBMZUJDTGFBUVSF XJUIDPNQMFYEBUBNBOJQVMBUJPO Ø  %FOFQSPCMFNTXIJDIXFMFBWFVOTPMWFE Ø  XSJUJOH42-XJUINVMUJQMFKPJOT DBTFFYQSFTTJPO BOEDPNQMFY QSFEJDBUFT Ø  PGBMM42-JOPVSQSPEVDU Ø  UIJTJTXIFSFSBX42-SPDLT Ø  EZOBNJD42-DPOTUSVDUJPOEFQFOEJOHPOVTFSJOQVU Ø  NBZCFXFTIPVMEVTFRVFSZCVJMEFS CVUOPUZFUJNQMFNFOUFE XIJDINFBOTOPUUIBUOFDFTTBSZBUUIFNPNFOU

Slide 17

Slide 17 text

IPX

Slide 18

Slide 18 text

IPX Ø  IUUQTHJUIVCDPNBDIJLVEHX Ø  6TFGVMJGZPVVTFXJUIHPHFOFSBUFDPNNBOE

Slide 19

Slide 19 text

%FNP

Slide 20

Slide 20 text

2"

Slide 21

Slide 21 text

2" 8FBSFIJSJOH