| Pixie :: Store. Pixie :: Store´Â ¹°¸®Àû ÀúÀå¼Ò¿¡ ´ëÇÑ Ãß»ó ÀÎÅÍÆäÀ̽ºÀÔ´Ï´Ù. |
Áö±Ý ´Ù¿î·Îµå |
Pixie :: Store. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À̸§:
- James Duncan
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~jduncan/Pixie-2.06/lib/Pixie/Store.pm
Pixie :: Store. ű×
Pixie :: Store. ¼³¸í
Pixie :: Store´Â ½ÇÁ¦ ÀúÀå¼ÒÀÇ Ãß»ó ÀÎÅÍÆäÀ̽ºÀÔ´Ï´Ù. Pixie :: Store´Â ¹°¸®Àû ÀúÀå¼Ò¿¡ ´ëÇÑ Ãß»ó ÀÎÅÍÆäÀ̽ºÀÔ´Ï´Ù. Àü°³ ½ºÅ©¸³Æ® : Pixie :: Store :: DBI; # µ¥ÀÌÅÍ ½ºÅä¾î¸¦ ¼³Á¤ÇÕ´Ï´Ù. pixie :: store :: dbi-> deploy (dbi : mysql : dbname = foo ', user =>'wibble ', pass =>'plib ', object_table =>'object '); pixie Ŭ¶óÀ̾ðÆ® : pixie »ç¿ë :: »óÁ¡ :: MySubclass; pixie¸¦ »ç¿ëÇϽʽÿÀ; MY $ PIXIE = PIXIE-> CONNECT ( 'Á¢µÎ»ç : mySPEC', »ç¿ëÀÚ => bill ', pass =>'flobadob '); Pixie :: Store´Â °´Ã¼¸¦ ½ÇÁ¦·Î ÀúÀåÇÏ´Â µ¥ »ç¿ëµÇ´Â ¹°¸®Àû ÀúÀå¼Ò¿¡ ´ëÇÑ Ãß»óÈ µÈ ÀÎÅÍÆäÀ̽º°¡ÀÖ´Â Pixie¸¦ Á¦°øÇÕ´Ï´Ù. ±× pixie°¡ °ü¸®ÇÕ´Ï´Ù. '°ø°³'¼ö¾÷ÀÌ ¾Æ´Õ´Ï´Ù. ´ëºÎºÐÀÇ Pixie »ç¿ëÀÚ´Â ÀûÀýÇÑ ÇÏÀ§ Ŭ·¡½ºÀÇ Deploy ¸Þ¼µå¸¦ È£Ãâ ÇÒ ¼öÀÖ´Â °Íµµ Á¦¿ÜÇÏ°í´ÂÀ̸¦ ÅÍÄ¡ ÇÒ ÇÊ¿ä°¡ ¾ø½À´Ï´Ù. ¾î¶² ÀúÀå¼Ò ¸Åü¸¦ Pixie¿¡ Ãß°¡ÇÏ·Á¸é ¿©±â¿¡¼ ½ÃÀÛÇϽʽÿÀ. ƯÁ¤ RDBMS¿¡ ÀúÀåÇϱâÀ§ÇÑ Æ¯Á¤ ¸Þ¼µå¸¦ Ãß°¡ÇÏ·Á¸é Pixie :: Store :: DBI :: Default ¹× Woefully Underdocumented Friends.The Public InterfaceThere´Â °ø°³µÇÁö ¾Ê½À´Ï´Ù. Pixie :: Store¿¡ ´ëÇÑ ÀÎÅÍÆäÀ̽º. ±×·¯³ª ÀûÀýÇÑ °æ¿ì Pixie :: Store Subclasses´Â ³ªÁß¿¡ ¿¬°áÇÒ ¼öÀÖ´Â ÀûÀýÇÑ ÀúÀå ±¸Á¶¸¦ ¼³Á¤ÇÒ Ã¥ÀÓÀÌÀÖ´Â ¹èÆ÷ ¹æ¹ýÀ» ±¸ÇöÇÒ ¼ö ÀÖ½À´Ï´Ù. ¼ºê Ŭ·¡½Ä °¡´É Interfacepixie :: Store´Â °ÅÀÇ ¾Æ¹« ¹æ¹ýµµ ±¸ÇöÇÏÁö ¾Ê½À´Ï´Ù. ÀÚüÀûÀ¸·Î '½ºÅ丮Áö »ç¾ç'(Classic DBI µ¥ÀÌÅÍ ¼Ò½º ½ºÆå À¸·ÎÀÇ ¾ç½Ä¿¡¼ À¯»ç), ½ÇÁ¦ ¿¬°á¿¡ »ç¿ëÇÒ ÄÜÅ©¸®Æ® ¼ºê Ŭ·¡½º°¡ ÀÛµ¿ÇÏ°í ÇÊ¿äÇÑ °æ¿ì ÇØ´çÇÏ´Â ÄÜÅ©¸®Æ® ¼ºê Ŭ·¡½º¸¦ Á¦¿ÜÇÏ°í´Â ÇØ´ç µå¶óÀ̺긦 »ç¿ëÇÏ´Â °æ¿ì Store object.But Pixie ÀûÀýÇÑ ´ÙÀ½ ¸Þ¼Òµå¿¡ ´ëÇØ ±âÁ¸ ¹× ÀÛ¾÷ (spec, @args)À» ±âÁ¸ ¸Þ¼Òµå¿¡ µû¶ó ´Ù¸¨´Ï´Ù. ¿¬°á (spec, @args)Àº ½ÇÁ¦ ¿¬°áÀ» ¸¸µé°í ÇØ´ç Ŭ·¡½ºÀÇ ¿ÀºêÁ§Æ®¸¦ ¹ÝȯÇÕ´Ï´Ù. ÀÎÅÍÆäÀ̽ºÀÇ À¯ÀÏÇÑ °íÁ¤ ºÎºÐÀº ½ºÅ丮Áö »ç¾çÀº ¸ÕÀú ¿Ã °ÍÀÌ°í, ±× ÀúÀåµÈ ºÎºÐÀº ÀúÀå »ç¾çÀÌ 'ID : ...'ó·³ º¸ÀÌ´Â °æÇâÀÌ ÀÖ½À´Ï´Ù. 'ID :'ű״ Pixie :: Store :: Connect¸¦ »ç¿ëÇÏ¿© ÀνºÅϽºÈ ÇÒ ÇÏÀ§ Ŭ·¡½º¸¦ ½Äº°ÇÕ´Ï´Ù. "TypeMap"Àº Works.CleaREMECTIESIESÀÇ µ¥ÀÌÅÍ ÀúÀå¼Ò°¡ ÀúÀåµÈ ¸ðµç °´Ã¼¿Í °ü·Ã ¸ÞŸ µ¥ÀÌÅ͸¦ Á¦°ÅÇÏ´Â ¹æ¹ý¿¡ ´ëÇÑ ÀÚ¼¼ÇÑ ³»¿ëÀÌ ÀÖ½À´Ï´Ù. ÁÖÀÇÇؼ »ç¿ëÇϽʽÿÀ. (Çϳª°¡ Å×½ºÆ® ½ºÅ©¸³Æ®¸¦ ¾²´Â °æ¿ì¿¡´Â ÇöÀúÇÏ°Ô Æí¸®ÇÕ´Ï´Ù ...) Store_AT (OID, Flattened_Object) Flattened_Object¸¦ ÃëÇÏ°í ÁÖ¾îÁø OID¸¦ ÅëÇØ ¹ß°ß ÇÒ ¼öÀÖ´Â °÷À» ¼û ±é´Ï´Ù. Flattened_Object´Â ÀÓÀÇ·Î ±ä ¹ÙÀÌÆ® ¹®ÀÚ¿ (´ÜÁö ½±°Ô ½±°Ô ...)À¸·Î º¸ÀåµË´Ï´Ù. OID´Â ÃÖ´ë 255 ÀÚÀÇ ¹®ÀÚ¿ÀÔ´Ï´Ù. OID.get_Object_AT (OID)ÀÇ ±âÁ¸ Ç׸ñÀ» µ¤¾î ¾¹´Ï´Ù. ÁöÁ¤µÈ OID¿Í ¿¬°üµÈ °´Ã¼°¡ Á¸ÀçÇÏ´Â °æ¿ì ¹ÝȯÇÕ´Ï´Ù. °´Ã¼°¡ ¾øÀ¸¸é ÇØ´ç °´Ã¼°¡ ¾øÀ¸¸é ÇØ´ç °´Ã¼¸¦ ãÀ» ¼ö¾ø´Â °æ¿ì ºñ¾îÀÖ´Â ¸ñ·ÏÀ» ¹ÝȯÇÏ°í ÇØ´ç OID¿Í ¿¬°áµÈ µÎ °³ ÀÌ»óÀÇ °³Ã¼¸¦ ãÀ¸¸é ¿¹¿Ü¸¦ ´øÁ³½À´Ï´Ù. (OID´Â ¸ðµç ÈÄ¿¡ °íÀ¯ÇؾßÇÕ´Ï´Ù.) .delete (OID) OID¿Í ¿¬°áµÈ °´Ã¼¸¦ »èÁ¦ÇÕ´Ï´Ù. ¿ÀºêÁ§Æ®°¡ Á¸ÀçÇÏÁö ¾Ê°Å³ª ±×·± object.lockPossibilite°¡ ¾Æ´Ï¶ó°í ºÎÈ£°¡ ¾øÀ»¸¸Å À߸øµÈ °æ¿ì´Â true¸¦ ¹ÝȯÇÕ´Ï´Ù. ´Ù¸¥ ´©±¸µµ ¹æÇØÇÏÁö ¾Êµµ·Ï µ¥ÀÌÅͺ£À̽º¸¦ Àá±Þ´Ï´Ù. (½ÇÁ¦·Î, Á¾Á¾ 'Begin Transaction'À¸·Î ±¸ÇöµË´Ï´Ù ...). Unlockagain, ¾Æ¸¶µµ À߸ø ±¸¼º ÇÒ ¼ö ÀÖ½À´Ï´Ù. »ðÀÔ µÈ ¸ðµç º¯°æ »çÇ×ÀÌ ½ÇÁ¦·Î »ðÀÔµÇ¾î ´Ù¸¥ »ç¿ëÀÚ¸¦ À§ÇØ µ¥ÀÌÅͺ£À̽º¸¦ ÇØÁ¦ÇÕ´Ï´Ù. ¾Æ¸¶µµ 'commit'.rollbackrolls°¡ ¸¶Áö¸·'Àá±Ý '¿¡ÀÖ´Â »óÅ·ΠµÇµ¹¾Æ °¡°Ô µÉ ¼ö ÀÖ½À´Ï´Ù. À߸øµÈ °ÍÀº ¾Æ´Õ´Ï´Ù. (Hurray). TypeMaponce ÇÏÀ§ Ŭ·¡½º°¡ÀÖ´Â Pixie :: Store°¡ »õ ÇÏÀ§ Ŭ·¡½º¿¡ ´ëÇØ ¾Ë·Á ÁÖ½Ã¸é ¿¬°á ÀÛ¾÷À» ÇÒ ¼ö ÀÖ½À´Ï´Ù. À̸¦ ¼öÇàÇÏ·Á¸é ÇØ´ç Á¢µÎ»ç ¹®ÀÚ¿À» ¼±ÅÃÇÏ¿© ÇÏÀ§ Ŭ·¡½º¸¦ ½Äº°ÇÏ°í ´ÙÀ½°ú °°Àº °ÍÀ» Ãß°¡ÇϽʽÿÀ. 'Pixie :: Store'»ç¿ë ÈÄ ´ÙÀ½°ú °°ÀÌ Ãß°¡ÇϽʽÿÀ. ºÎÇ° ¶Ç´Â »çÅ°¡ ±úÁø´Ù : $ pixie :: store :: typemap {prefix} = __package __;ÀÌ ÀÛ¾÷À» ¼öÇàÇÏ¸é ½Ã³ñ½Ã½º¿¡ ÁÖ¾îÁø Äڵ尡 ¸¶¼ú¿¡ ÀÇÇØ ¸¶Ä¡ ÀÛ¼ºÇؾßÇÕ´Ï´Ù. ¿ä±¸ »çÇ× : ¡¤ Perl.
Pixie :: Store. °ü·Ã ¼ÒÇÁÆ®¿þ¾î