Skip to main content
DevTools24

JSON से PostgreSQL क्वेरी बिल्डर

JSON डेटा पेस्ट करें, आवश्यक फील्ड्स विज़ुअली चुनें और तुरंत PostgreSQL JSONB क्वेरी जनरेट करें। एरो नोटेशन और पाथ फंक्शन को सपोर्ट करता है।

PostgreSQL JSONB Operators

->Get JSON object field (returns JSON)
->>Get JSON object field as text
#>Get JSON at path (returns JSON)
#>>Get JSON at path as text
@>Contains (for filtering)
?Key exists check

कब उपयोग करें

  • PostgreSQL JSONB कॉलम में स्टोर नेस्टेड JSON क्वेरी करना
  • सिंटैक्स याद किए बिना कॉम्प्लेक्स एक्सट्रैक्शन क्वेरी बनाना
  • JSON डेटा के साथ NoSQL से PostgreSQL में माइग्रेट करना
  • PostgreSQL JSONB ऑपरेटर और फंक्शन सीखना

प्रो टिप्स

  • टेक्स्ट एक्सट्रैक्शन के लिए ->> का उपयोग करें (WHERE कम्पेरिजन के लिए जरूरी)
  • -> ऑपरेटर JSON रिटर्न करता है, जबकि ->> टेक्स्ट रिटर्न करता है
  • GIN इंडेक्स @> कंटेनमेंट क्वेरी के साथ सबसे अच्छा काम करते हैं
  • डीपली नेस्टेड डेटा के लिए पाथ फंक्शन अधिक पठनीय हैं

JSON to PostgreSQL Query Builder - तकनीकी विवरण

PostgreSQL provides powerful JSONB support for storing and querying JSON data. The -> operator returns JSON, while ->> returns text. For nested paths, use #> and #>> or the jsonb_extract_path functions. This tool helps you build these queries visually without memorizing the syntax.

कमांड-लाइन विकल्प

-- Arrow notation
SELECT data->'user'->>'name' FROM users;

-- Path function
SELECT jsonb_extract_path_text(data, 'user', 'name') FROM users;

-- Containment query (uses GIN index)
SELECT * FROM users WHERE data @> '{"status": "active"}';

संदर्भ

आधिकारिक स्पेसिफिकेशन देखें