• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

super3 / lowerproptax / 19052556127

03 Nov 2025 11:27PM UTC coverage: 74.51% (-8.4%) from 82.946%
19052556127

push

github

super3
Add PostgreSQL database integration with country field support

- Replace in-memory Map storage with PostgreSQL using pg package
- Auto-create properties table on server startup with schema
- Add country field to property model for international support
- Update frontend to send country data from Google Maps autocomplete
- Convert database column names (snake_case) to API format (camelCase)
- Add mock database for testing without PostgreSQL locally
- Update all 40 tests to work with async database operations
- Maintain user isolation and security with parameterized queries

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

44 of 54 branches covered (81.48%)

Branch coverage included in aggregate %.

25 of 38 new or added lines in 3 files covered. (65.79%)

70 of 99 relevant lines covered (70.71%)

7.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/db/init.js
1
import pool from './connection.js';
2

3
// Initialize database tables
4
export async function initDatabase() {
NEW
5
  try {
×
NEW
6
    console.log('Initializing database...');
×
7

8
    // Create properties table if it doesn't exist
NEW
9
    const createPropertiesTable = `
×
10
      CREATE TABLE IF NOT EXISTS properties (
11
        id VARCHAR(255) PRIMARY KEY,
12
        user_id VARCHAR(255) NOT NULL,
13
        address VARCHAR(500) NOT NULL,
14
        city VARCHAR(255),
15
        state VARCHAR(100),
16
        zip_code VARCHAR(20),
17
        country VARCHAR(100),
18
        lat DECIMAL(10, 8),
19
        lng DECIMAL(11, 8),
20
        created_at TIMESTAMP DEFAULT NOW(),
21
        updated_at TIMESTAMP DEFAULT NOW()
22
      );
23

24
      CREATE INDEX IF NOT EXISTS idx_properties_user_id ON properties(user_id);
25
    `;
26

NEW
27
    await pool.query(createPropertiesTable);
×
NEW
28
    console.log('Database initialized successfully');
×
29
  } catch (error) {
NEW
30
    console.error('Error initializing database:', error);
×
NEW
31
    throw error;
×
32
  }
33
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc