Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function getData() {
- try {
- const [ users , charts ] = await Promise.all([
- db('users').select('*'),
- db('chats').select('*')
- ]);
- console.log('users', users);
- console.log('chats', chats);
- }
- catch(err) {
- console.log(err)
- }
- }
- getData()
- ============ OUTPUT ==============
- users [ anonymous {
- id: 1,
- user_id: '7d3858a9-dbc3-4c43-b7c7-422136e5a3fc',
- created_at: '1511378256429',
- username: 'leptone',
- password: '1245' },
- anonymous {
- id: 2,
- user_id: 'c9f1f03e-8a01-452a-8e9e-1d83efd8e56a',
- created_at: '1511378256429',
- username: 'csiebel',
- password: '1245' } ]
- ReferenceError: chats is not defined
- at getData (/Users/casey/Dev/lang-exchange/src/server/db/seeds/user_chat_seed.js:11:30)
- at <anonymous>
Add Comment
Please, Sign In to add comment