Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply CompositeStorage to JS package #1084

Merged
merged 4 commits into from
Feb 10, 2023
Merged

Conversation

panarch
Copy link
Member

@panarch panarch commented Feb 8, 2023

  • Fix nodejs build (use only memory storage for nodejs build

Now this kind of example codes work!
e.g.

const db = await gluesql();                                 
await db.loadIndexedDB();                                   
                                                            
const result = await db.query(`                             
  DROP TABLE IF EXISTS Foo, Bar;                            
  CREATE TABLE Foo (id INTEGER, name TEXT);                 
  CREATE TABLE Bar (bar_id INTEGER) ENGINE = indexedDB;     
  INSERT INTO Foo VALUES (1, 'hello'), (2, 'world');        
  INSERT INTO Bar VALUES (10), (20);                        
  SELECT *, id as wow_id FROM Foo JOIN Bar;                 
`);                                                         
                                                            
for (const item of result) {                                
  const node = document.createElement('code');              
                                                            
  node.innerHTML = `                                        
    type: ${item.type}                                      
    <br>                                                    
    ${item.affected ? `affected: ${item.affected}` : ''}    
    ${item.rows ? `rows: ${JSON.stringify(item.rows)}` : ''}
  `;                                                        
                                                            
  console.log(item);                                        
  document.querySelector('#box').append(node);              
}                                                           

@panarch panarch self-assigned this Feb 8, 2023
@coveralls
Copy link

coveralls commented Feb 8, 2023

Pull Request Test Coverage Report for Build 4132219860

  • 7 of 7 (100.0%) changed or added relevant lines in 5 files are covered.
  • 15 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.05%) to 98.663%

Files with Coverage Reduction New Missed Lines %
core/src/executor/evaluate/stateless.rs 15 94.09%
Totals Coverage Status
Change from base Build 4110793318: 0.05%
Covered Lines: 39037
Relevant Lines: 39566

💛 - Coveralls

@panarch panarch marked this pull request as ready for review February 9, 2023 08:13
@panarch panarch added the improvement Improvements for existing features label Feb 9, 2023
Copy link
Member

@ever0de ever0de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best! CompositeStorage can now be used in the web environment

@panarch panarch merged commit dfa27fc into main Feb 10, 2023
@panarch panarch deleted the apply-composite-storage-to-js-pkg branch February 10, 2023 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvements for existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants