Created
February 6, 2018 12:21
-
-
Save selam/72a13905d24b66f8d34464766d41888d to your computer and use it in GitHub Desktop.
golang pseducode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var longTable = make(map[string]DBStruct) | |
func LoadFromDB(db) { | |
rows, err := db.Query("SELECT * FROM 4millionrowTable") | |
for rows.Next() { | |
st := DBStruct{} | |
rows.Scan( | |
&st.FieldOne, | |
&st.FieldTwo, // until Field14 | |
) | |
longTable[st.FieldOne + ":" + st.FieldTwo] = st | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment